0

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 hyprlinkr?

Tried:

linker.GetUri<MyController>(c => c.Search(null).ToString()

which throws a NullReferenceException, the same does

linker.GetUri<MyController>(c => c.Search(new int?()).ToString()

TIA

smolesen
  • 1,153
  • 3
  • 11
  • 29

1 Answers1

0

Nullable seems to be supported with the latest version 1.0.1 of HyprLinkr, just use:

linker.GetUri<MyController>(c => c.Search(new int?()).ToString()
smolesen
  • 1,153
  • 3
  • 11
  • 29