Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        protected void Application_Start()
        {
            //Handling Circular Object References in json/xml serialize
            //var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
            //json.SerializerSettings.PreserveReferencesHandling =
            //    Newtonsoft.Json.PreserveReferencesHandling.All;
            //var xml = GlobalConfiguration.Configuration.Formatters.XmlFormatter;
            //var dcs = new DataContractSerializer(typeof(City), null, int.MaxValue,
            //    false, /* preserveObjectReferences: */ true, null);
            //xml.SetSerializer<City>(dcs);



            Database.SetInitializer(new MigrateDatabaseToLatestVersion <MainContext, Configuration>());
            //Database.SetInitializer(new MigrateDatabaseToLatestVersion<ApplicationDbContext, ConfigurationUserAccount>());
            IoCBinder.InitStructureMap();


            AreaRegistration.RegisterAllAreas();

            GlobalConfiguration.Configure(WebApiConfig.Register);
            // WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);


            // var projectCategoryService = ObjectFactory.GetInstance<IProjectCategoryService>();

            AutoMapperWebConfiguration.ConfigureUserMapping();
        }