예제 #1
0
 public UserManageService(
     UserManager <IdentityUser> userManager,
     RoleManager <IdentityRole> roleManager,
     AiplugsDbContext db
     )
 {
     _userManager = userManager;
     _roleManager = roleManager;
     _db          = db;
 }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }
예제 #4
0
        // 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();
        }
예제 #5
0
 public FileRepository(AiplugsDbContext db)
 {
     _db = db;
 }
예제 #6
0
 public DataRepository(AiplugsDbContext db, IQueryBuilder queryBuilder)
 {
     _db           = db;
     _queryBuilder = queryBuilder;
 }
예제 #7
0
 public FolderRepository(AiplugsDbContext db)
 {
     _db = db;
 }
예제 #8
0
 public JobRepository(AiplugsDbContext db)
 {
     _db = db;
 }