protected void SetupDbAndLogger() { var options = new DbContextOptionsBuilder <ShopBridgeDbContext>() .UseInMemoryDatabase(databaseName: "ShopBridgeInMemoryDB") .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning)) .Options; ShopBridgeDbContext = new ShopBridgeDbContext(options); var serviceProvider = new ServiceCollection().AddLogging().BuildServiceProvider(); LoggerFactory = serviceProvider.GetService <ILoggerFactory>(); }
public Repository(ShopBridgeDbContext context) { this.context = context; entities = context.Set <T>(); }
public void TearDown() { ShopBridgeDbContext.Dispose(); }
public UnitOfWork(ShopBridgeDbContext context) { this.context = context; }
public InventoryMgmtService(ShopBridgeDbContext dbContext, ILogger <InventoryMgmtService> logger) { _dbContext = dbContext; _logger = logger; }