コード例 #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            IocConfig.RegisterDependencyResolver(GlobalConfiguration.Configuration);
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            DtoMapperConfig.CreateMaps();

            CorsConfig.RegisterCors(GlobalConfiguration.Configuration);
        }
コード例 #2
0
        public void Initialize()
        {
            var configuration = new HttpConfiguration();

            IocConfig.RegisterDependencyResolver(configuration);
            WebApiConfig.Register(configuration);
            DtoMapperConfig.CreateMaps();

            server = new HttpServer(configuration);

            // This test runs under the context of my user
            // account (Windows Identity) and hence I clear that
            Thread.CurrentPrincipal = new GenericPrincipal(
                new GenericIdentity(String.Empty),
                null);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            //var configuration = new HttpSelfHostConfiguration("http://localhost:8086");
            var configuration = new MySelfHostConfiguration("https://localhost:8086");

            WebApiConfig.Register(configuration);
            DtoMapperConfig.CreateMaps();
            IocConfig.RegisterDependencyResolver(configuration);

            using (HttpSelfHostServer server = new HttpSelfHostServer(configuration))
            {
                server.OpenAsync().Wait();
                Console.WriteLine("Press Enter to terminate the server...");
                Console.ReadLine();
            }
        }
コード例 #4
0
 protected void Application_Start(object sender, EventArgs e)
 {
     WebApiConfig.Register(GlobalConfiguration.Configuration);
     DtoMapperConfig.CreateMaps();
 }
コード例 #5
0
 public void Initialize()
 {
     DtoMapperConfig.CreateMaps();
 }