عنوان:

‫کتابخانه Hyprlinkr


نویسنده: وحید محمدطاهری
تاریخ: ۱۳۹۵/۰۸/۲۸ ۱۹:۳۱
آدرس: www.dntips.ir
A URI building helper library for ASP.NET Web API

Example

Imagine that you're using the standard route configuration created by the Visual Studio project template:

name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }

In that case, you can create an URI to a the resource handled by the FooController.GetById Action Method like this:

var uri = linker.GetUri<FooController>(r => r.GetById(1337));

This will create a URI like this:

  http://localhost/api/foo/1337    


مشاهده مطلب اصلی