Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews();
            services.AddDbContextPool <MobileDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("MobileDbConnection")));

            services.AddIdentity <IdentityUser, IdentityRole>(config =>
            {
                config.Password.RequiredLength         = 4;
                config.Password.RequireDigit           = false;
                config.Password.RequireNonAlphanumeric = false;
                config.Password.RequireUppercase       = false;
            })
            .AddEntityFrameworkStores <MobileDbContext>()
            .AddDefaultTokenProviders();

            ContainerConfiguration.DependencyMapping(services);
            //services.AddAuthentication("cookieAuth")
            //.AddCookie("cookieAuth", config =>
            //{
            //    config.Cookie.Name = "Custom.cookie";
            //    config.LoginPath = "/Account/Login";
            //});
        }
Ejemplo n.º 2
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddControllersWithViews();
     services.AddDbContextPool <MobileDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("MobileDbConnection")));
     ContainerConfiguration.DependencyMapping(services);
 }