public void Configuration_is_valid() { var autoMapperStartupTask = new AutoMapperStartupTask(); autoMapperStartupTask.Execute(); Mapper.AssertConfigurationIsValid(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(o => o.LoginPath = "/Account/Login"); services.AddScoped <IBlockchainApi, BlockchainApi>(); services.AddScoped <IDatabaseSettings, DatabaseSettings>(); services.AddScoped <IUserService, UserService>(); services.AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_2_2) .AddNToastNotifyToastr(); services.Configure <AppConfiguration>(Configuration.GetSection("AppConfiguration")); AutoMapperStartupTask.Execute(); }
protected void Application_Start() { AutoMapperStartupTask.Execute(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); AreaRegistration.RegisterAllAreas(); // Register for auto mapper IStartupTask task = new AutoMapperStartupTask(); task.Execute(); }
protected void Application_Start() { AutofacExt.InitAutofac(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); //using (TestMigrationContext context = new TestMigrationContext()) //{ // //context.Database.Initialize(true); //} AutoMapperStartupTask.Configure(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); ContainerConfig.RegisterDependencies(); // Register for auto mapper IStartupTask task = new AutoMapperStartupTask(); task.Execute(); }
protected void Application_Start() { //we don't use SoftDeleteInterceptor in WebApi //so we replaced it here DbConfiguration.Loaded += (_, a) => { a.ReplaceService <IDbCommandTreeInterceptor>((s, k) => new NullInterceptor()); }; GlobalConfiguration.Configure(WebApiConfig.Register); //start StartupTask manually var autoMapperStartupTask = new AutoMapperStartupTask(); autoMapperStartupTask.Execute(); }
public void Setup() { var autoMapperStartupTask = new AutoMapperStartupTask(); autoMapperStartupTask.Execute(); }