ASP.NET WebAPI route config sample with Action name

Standard
public static void Register(HttpConfiguration config)
{
    config.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{action}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );
    config.EnableSystemDiagnosticsTracing();
    config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = 
                             new CamelCasePropertyNamesContractResolver();
}
Advertisements

One thought on “ASP.NET WebAPI route config sample with Action name

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s