public UserManageService( UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager, AiplugsDbContext db ) { _userManager = userManager; _roleManager = roleManager; _db = db; }
public AccountController( UserManager <User> userManager, SignInManager <User> signInManager, RoleManager <Role> roleManager, AiplugsDbContext db, ILogger <AccountController> logger) { _userManager = userManager; _signInManager = signInManager; _roleManager = roleManager; _db = db; _logger = logger; }
public SQLiteTestDb(bool migration = true) { Connection = new SqliteConnection("DataSource=:memory:"); Connection.Open(); var options = new DbContextOptionsBuilder<AiplugsDbContext>() .UseSqlite(Connection) .Options; Context = new AiplugsDbContext(options); Context.Database.EnsureCreated(); DataRepository = new DataRepository(Context, new SqliteQueryBuilder()); FileRepository = new FileRepository(Context); FolderRepository = new FolderRepository(Context); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime, AiplugsDbContext dbContext) { dbContext.Database.Migrate(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Default/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Default}/{action=Index}/{id?}"); }); app.UseAiplugsCMS(); }
public FileRepository(AiplugsDbContext db) { _db = db; }
public DataRepository(AiplugsDbContext db, IQueryBuilder queryBuilder) { _db = db; _queryBuilder = queryBuilder; }
public FolderRepository(AiplugsDbContext db) { _db = db; }
public JobRepository(AiplugsDbContext db) { _db = db; }