protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); MembershipConfig.Register(); }
public SiteContext() { Auth = new AuthConfig(); LocalAuth = new LocalAuthConfig(); Stripe = new StripeConfig(); Email = new EmailConfig(); Membership = new MembershipConfig(); Paging = new PagingConfig(); ConfigurationBuilder.LoadConfiguration(this); }
public SiteContext() { Auth = new AuthConfig(); LocalAuth = new LocalAuthConfig(); Stripe = new StripeConfig(); Email = new EmailConfig(); Membership = new MembershipConfig(); Paging = new PagingConfig(); ConfigurationBuilder.LoadConfiguration(this); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // BundleTable.EnableOptimizations = true; // Map AutoMapper mappings. // MapperConfig.RegisterMappings(); MembershipConfig.SeedMembership(); }
private void SeedMembership() { //Initialize WebSecurity instance to the database connection MembershipConfig.RegisterMembership(); var roles = (SimpleRoleProvider)Roles.Provider; var membership = (SimpleMembershipProvider)Membership.Provider; if (!roles.RoleExists("Admin")) { roles.CreateRole("Admin"); } if (membership.GetUser("Sallen", false) == default(MembershipUser)) { membership.CreateUserAndAccount("Sallen", "Password-1"); } if (!roles.GetRolesForUser("Sallen").Contains("Admin")) { roles.AddUsersToRoles(new string[] { "Sallen" }, new string[] { "Admin" }); } }
public static void Enable(MembershipConfig config) { _config = config; }