Example #1
0
 public static void Seed(this BaseProjectDbContext db, IWebHost host)
 {
     if (db.AllMigrationsApplied())
     {
         BaseProjectInitializer.Initialize(db);
     }
 }
 public UserCommandHandler(BaseProjectDbContext context, IMapper mapper, UserManager userManager, ITokenFactory tokenFactory, IJwtFactory jwtFactory)
 {
     _context      = context;
     _mapper       = mapper;
     _userManager  = userManager;
     _tokenFactory = tokenFactory;
     _jwtFactory   = jwtFactory;
 }
Example #3
0
 /// <summary>
 /// Constructs a new instance of <see cref="RoleStore"/>.
 /// </summary>
 /// <param name="context">The <see cref="IBaseProjectUow"/>.</param>
 /// <param name="describer">The <see cref="IdentityErrorDescriber"/>.</param>
 public RoleStore(BaseProjectDbContext context, IdentityErrorDescriber describer = null)
 {
     if (context == null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     _db            = context;
     ErrorDescriber = describer ?? new IdentityErrorDescriber();
 }
        public static void SeedHostDb(BaseProjectDbContext context)
        {
            context.SuppressAutoSetTenantId = true;

            // Host seed
            new InitialHostDbBuilder(context).Create();

            // Default tenant seed (in host database).
            new DefaultTenantBuilder(context).Create();
            new TenantRoleAndUserBuilder(context, 1).Create();
        }
Example #5
0
        public static bool AllMigrationsApplied(this BaseProjectDbContext db)
        {
            var applied = db.GetService <IHistoryRepository>()
                          .GetAppliedMigrations()
                          .Select(m => m.MigrationId);

            var total = db.GetService <IMigrationsAssembly>()
                        .Migrations
                        .Select(m => m.Key);

            return(!total.Except(applied).Any());
        }
 public GetSeparationByPlantHandler(BaseProjectDbContext db, IMapper mapper, UserManager user)
 {
     _context      = db;
     _mapper       = mapper;
     _userMananger = user;
 }
 public DefaultEditionCreator(BaseProjectDbContext context)
 {
     _context = context;
 }
 public DefaultLanguagesCreator(BaseProjectDbContext context)
 {
     _context = context;
 }
 public GetMunicipioListQueryHandler(BaseProjectDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public UpdateCategoryCommandHandler(BaseProjectDbContext db)
 {
     _context = db;
 }
 public CreateCategoryCommandHandler(BaseProjectDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #12
0
 public HostRoleAndUserCreator(BaseProjectDbContext context)
 {
     _context = context;
 }
 public GetUserListQueryHandler(BaseProjectDbContext context, IMapper mapper, IHttpContextAccessor httpContextAccesor)
 {
     _context            = context;
     _mapper             = mapper;
     _httpContextAccesor = httpContextAccesor;
 }
 public DeleteCreditCardCommandHandler(BaseProjectDbContext db) : base(db)
 {
 }
Example #15
0
 public CreateAdministratorCommandHandler(BaseProjectDbContext db, UserManager userManager, IMapper mapper)
 {
     _db          = db;
     _userManager = userManager;
     _mapper      = mapper;
 }
Example #16
0
 protected UpdateCommandHandler(BaseProjectDbContext db, IMapper mapper) : base(db, mapper)
 {
 }
 protected DeleteCommandHandler(BaseProjectDbContext db) : base(db)
 {
 }
Example #18
0
 protected GetByIdQueryHandler(BaseProjectDbContext db, IMapper mapper) : base(db, mapper)
 {
 }
 public GetCategoryParentListQueryHandler(BaseProjectDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #20
0
 public GetAdministratorDetailQueryHandler(BaseProjectDbContext db, IMapper mapper) : base(db, mapper)
 {
 }
 public UpdatePlantCommandHandler(BaseProjectDbContext db, UserManager userManager)
 {
     _context     = db;
     _userManager = userManager;
 }
 public TenantRoleAndUserBuilder(BaseProjectDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Example #23
0
 public DefaultSettingsCreator(BaseProjectDbContext context)
 {
     _context = context;
 }
 public InitialHostDbBuilder(BaseProjectDbContext context)
 {
     _context = context;
 }
 public GetSepartionListQueryHandler(BaseProjectDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #26
0
 public DefaultTenantBuilder(BaseProjectDbContext context)
 {
     _context = context;
 }
Example #27
0
 public GetUserDetailQueryHandler(BaseProjectDbContext db, IMapper mapper, UserManager user)
 {
     _context      = db;
     _mapper       = mapper;
     _userMananger = user;
 }
 public DeletePlantCommandHandler(BaseProjectDbContext db)
 {
     _context = db;
 }
Example #29
0
 public DeleteAdministratorCommandHandler(BaseProjectDbContext db, UserManager userManager) : base(db)
 {
     _userManager = userManager;
 }
 public UpdateAdministratorCommandHandler(UserManager userManager, BaseProjectDbContext db, IMapper mapper)
     : base(db, mapper)
 {
     _userManager = userManager;
 }