mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-18 15:02:09 +00:00
30 lines
738 B
C#
30 lines
738 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Http.Formatting;
|
|
using System.Web.Http;
|
|
|
|
namespace ShadowServer.Base
|
|
{
|
|
/// <summary>
|
|
/// Web API配置
|
|
/// </summary>
|
|
public static class WebApiConfig
|
|
{
|
|
/// <summary>
|
|
/// 注册api controller
|
|
/// </summary>
|
|
/// <param name="config"></param>
|
|
public static void Register(HttpConfiguration config)
|
|
{
|
|
config.MapHttpAttributeRoutes();
|
|
|
|
config.Routes.MapHttpRoute(
|
|
name: "ActionApi",
|
|
routeTemplate: "api/{controller}/{action}/{id}",
|
|
defaults: new { id = RouteParameter.Optional }
|
|
);
|
|
}
|
|
}
|
|
}
|