using LHDN.CRM.BC.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace LHDN.CRM.WebAPI
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();
             
            config.Routes.MapHttpRoute(
               name: "GetByTypeAndIDApi",
               routeTemplate: "api/{controller}/{action}/{type}/{id}" 
            );
              
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}" ,
                defaults: new { id = RouteParameter.Optional }
            );

            config.MessageHandlers.Add(new Handlers.PerfLogHandler());
            config.MessageHandlers.Add(new Handlers.UPTimeStampHandler()); 
        }

        public static void Init()
        {
            AdminService.Init();
        }

    }
}
