public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, ILoggerFactory loggerFactory, ApplicationDbContext db, rmsContext context) { _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger <AccountController>(); _db = db; _context = context; }
public async static void Initialize(rmsContext db, RoleManager <IdentityRole> _roleManager, UserManager <ApplicationUser> _userManager) { db.Database.EnsureCreated(); // Look for any students. if (_roleManager.Roles.Any() || _userManager.Users.Any()) { return; // DB has been seeded } IdentityRole Role = new IdentityRole(); Role.NormalizedName = "ADMINISTRATOR"; Role.Name = "administrator"; await _roleManager.CreateAsync(Role); IdentityRole Role2 = new IdentityRole(); Role2.NormalizedName = "DATAENTRY"; Role2.Name = "dataentry"; await _roleManager.CreateAsync(Role2); IdentityRole Role3 = new IdentityRole(); Role3.NormalizedName = "GUEST"; Role3.Name = "guest"; await _roleManager.CreateAsync(Role3); var user = new ApplicationUser { UserName = "******", PhoneNumber = "99999999", FirstName = "admin", LastName = "admin", Email = "*****@*****.**", Position = "admin", Active = true, TenantId = 1 }; var result = await _userManager.CreateAsync(user, "159*951-Aa"); if (result.Succeeded) { await _userManager.AddClaimAsync(user, new System.Security.Claims.Claim("super_admin", "1")); await _userManager.AddToRoleAsync(user, "administrator"); } }
public FacilitiesController(rmsContext context, ApplicationDbContext db) { _context = context; _db = db; }
public AuthorizationsController(rmsContext context, ICipherService crypto) { _context = context; _crypto = crypto; }
public intakeController(rmsContext context, ICipherService crypto) { _context = context; _crypto = crypto; }
public RegistrationController(rmsContext context, ICipherService crypto) { _context = context; _crypto = crypto; }
public DistrictsController(rmsContext context) { _context = context; }
public ProvincesController(rmsContext context) { _context = context; }
public GbvController(rmsContext context, IDataProtectionProvider dataProtectionProvider, ICipherService crypto) { _context = context; _crypto = crypto; }
public TenantsController(rmsContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, rmsContext context, RoleManager <IdentityRole> _roleManager, UserManager <ApplicationUser> _userManager) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseIdentity(); // Add external authentication middleware below. To configure them please see https://go.microsoft.com/fwlink/?LinkID=532715 app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context, _roleManager, _userManager); }
public ConsentsController(rmsContext context, ICipherService crypto) { _context = context; _crypto = crypto; }
public AgencyTypesController(rmsContext context) { _context = context; }