Esempio n. 1
0
        public static void WebApiRegister(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional });

            JsonIDataSerialization.WrapJsonContentResolver(config);
        }
Esempio n. 2
0
        public static void WebApiRegister(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional });

            config.MessageHandlers.Add(new WrappingHandler());

            FluentValidationModelValidatorProvider.Configure(config);
            JsonIDataSerialization.WrapJsonContentResolver(config);
        }