Example #1
0
        public static void Register(HttpConfiguration config)
        {
            var provider = new StringParameterBinderProvider(new StringParameterBinder(), typeof(string));

            config.Services.Insert(typeof(ModelBinderProvider), 0, provider);
            config.Services.Replace(typeof(ITraceWriter), new LogWriter(WebContainerManager.Get <ILogManager>()));
            config.Services.Add(typeof(IExceptionLogger), new ExceptionLogger(WebContainerManager.Get <ILogManager>()));

            config.BindParameter(typeof(string), new StringParameterBinder());


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