Questions tagged [hyprlinkr]

Hyprlinkr is a small and very focused helper library for the ASP.NET Web API. It does one thing only: it creates URIs according to the application's route configuration in a type-safe manner.

Hyprlinkr is a small and very focused helper library for the ASP.NET Web API. It does one thing only: it creates URIs according to the application's route configuration in a type-safe manner.

7 questions
10
votes
2 answers

ASP Web Api - IoC - Resolve HttpRequestMessage

I am trying to set up Castle Windsor with ASP.NET WebAPI. I am also using the Hyprlinkr package (https://github.com/ploeh/Hyprlinkr) and so need an instance of HttpRequestMessage injected in to one of the dependencies of my controller. I am…
ChrisCa
  • 10,876
  • 22
  • 81
  • 118
7
votes
3 answers

How do I supply an Expression> in F# when the method has a return value?

I'm attempting to convert some C# code to F#. Specifically, I'm attempting to convert some code using Hyprlinkr to F#. The C# code looks like this: Href = this.linker.GetUri(c => c.Get("{file-name}")).ToString() where the…
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
5
votes
3 answers

How to set up Ninject DI to create Hyprlinkr RouteLinker instances

I have an MVC4 Web API project and I making use of Mark Seemann's Hyprlinkr component to generate Uris to linked resources. (Customer -> Addresses for example). I have already followed Mark's guide on Dependency injection with Web API (changing…
James Skimming
  • 4,991
  • 4
  • 26
  • 32
3
votes
3 answers

How to generate a link to an HTTP POST action with Hyprlinkr?

I'm trying to use Hyprlinkr to generate URL to the HTTP Post action. My controller looks like this: public class MyController : ApiController { [HttpPost] public void DoSomething([FromBody]SomeDto someDto) { ... } } with this…
Dmitry
  • 17,078
  • 2
  • 44
  • 70
2
votes
1 answer

Customize Hyprlinkr to use the name of a route's template

Context Given the following route config.Routes.MapHttpRoute( name: "FooBarBazRoute", routeTemplate: "foo-bar-baz/{id}", defaults: new { controller = "FooBarBaz", id = RouteParameter.Optional }); and by using…
Nikos Baxevanis
  • 10,868
  • 2
  • 46
  • 80
1
vote
1 answer

Integrating Hyprlinkr with Autofac

I'm trying to integrate Hyprlinkr in a WebAPI project with Autofac. I've started writing the custom IHttpControllerActivator but I get the following exception when trying to resolve the controller: No scope with a Tag matching 'AutofacWebRequest'…
David
  • 3,736
  • 8
  • 33
  • 52
0
votes
1 answer

How to handle nullable parameters with HyprLinkr?

In ASP.NET Web API, I have a action method, that look like this: [GET("?{optionalValue:int?}"), HttpGet] public HttpResponseMessage Search(int? optionalValue = null) How do I make a link, without the optionalValue parameter, using…
smolesen
  • 1,153
  • 3
  • 11
  • 29