Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWork"/> class. It will
 /// initialize the change tracker lazily.
 /// </summary>
 /// <param name="connectionString">The connection string to the database.</param>
 /// <param name="businessRuleRegistry">The registry for all business rules.</param>
 public UnitOfWork(string connectionString, IBusinessRuleRegistry businessRuleRegistry)
 {
     this.RegisterRepositories();
     this.connectionString           = connectionString;
     this.productManagementDbContext = this.CreateContext();
     this.businessRuleRegistry       = businessRuleRegistry;
     this.changeTracker = new Lazy <ChangeTracker>(() => new ChangeTracker(this.productManagementDbContext));
 }
Пример #2
0
        public static void SeedHostDb(ProductManagementDbContext 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();
        }
Пример #3
0
 public ManufacturerRepository(ProductManagementDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Пример #4
0
 /// <summary>
 /// The constructor
 /// </summary>
 public JwtAuthenticationController()
 {
     dbContext = new ProductManagementDbContext();
 }
Пример #5
0
 public AdminsController(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #6
0
 public Repository(ProductManagementDbContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
 public LoginCustomersController(ProductManagementDbContext context)
 {
     _context = context;
 }
 public HostRoleAndUserCreator(ProductManagementDbContext context)
 {
     _context = context;
 }
 public DefaultTenantBuilder(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #10
0
 public DefaultSettingsCreator(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Repository{T}"/> class.
 /// </summary>
 /// <param name="productManagementDbContext">The database context dependency.</param>
 public Repository(ProductManagementDbContext productManagementDbContext) =>
 this.productManagementDbContext = productManagementDbContext;
 public DefaultLanguagesCreator(ProductManagementDbContext context)
 {
     _context = context;
 }
 public OrdersController(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #14
0
 public CartsController(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #15
0
 public InitialHostDbBuilder(ProductManagementDbContext context)
 {
     _context = context;
 }
Пример #16
0
 public ProductRepository(ProductManagementDbContext context) : base(context)
 {
 }
 public TenantRoleAndUserBuilder(ProductManagementDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
 public RoleRepository(ProductManagementDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Пример #19
0
 public DefaultEditionCreator(ProductManagementDbContext context)
 {
     _context = context;
 }