0
在ASP.NET的Web API,我有一個動作方法,看起來像這樣:如何使用HyprLinkr處理可空參數?
[GET("?{optionalValue:int?}"), HttpGet]
public HttpResponseMessage Search(int? optionalValue = null)
我如何做一個鏈接,沒有optionalValue參數,使用hyprlinkr?
嘗試:
linker.GetUri<MyController>(c => c.Search(null).ToString()
會拋出一個NullReferenceException,同樣不
linker.GetUri<MyController>(c => c.Search(new int?()).ToString()
TIA