KEMBAR78
Web Api Config | PDF | Business | Computers
0% found this document useful (0 votes)
18 views1 page

Web Api Config

This C# code defines a WebApiConfig class that registers routes for a Web API with attributes and a default route.

Uploaded by

Hacker Hacker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Web Api Config

This C# code defines a WebApiConfig class that registers routes for a Web API with attributes and a default route.

Uploaded by

Hacker Hacker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace PTC
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes


config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}

You might also like