/// <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)); }
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(); }
public ManufacturerRepository(ProductManagementDbContext dbContext) { _dbContext = dbContext; }
/// <summary> /// The constructor /// </summary> public JwtAuthenticationController() { dbContext = new ProductManagementDbContext(); }
public AdminsController(ProductManagementDbContext context) { _context = context; }
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; }
public DefaultSettingsCreator(ProductManagementDbContext context) { _context = context; }
/// <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; }
public CartsController(ProductManagementDbContext context) { _context = context; }
public InitialHostDbBuilder(ProductManagementDbContext context) { _context = context; }
public ProductRepository(ProductManagementDbContext context) : base(context) { }
public TenantRoleAndUserBuilder(ProductManagementDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public RoleRepository(ProductManagementDbContext dbContext) { _dbContext = dbContext; }
public DefaultEditionCreator(ProductManagementDbContext context) { _context = context; }