예제 #1
0
        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>();
        }
예제 #2
0
 public Repository(ShopBridgeDbContext context)
 {
     this.context = context;
     entities     = context.Set <T>();
 }
예제 #3
0
 public void TearDown()
 {
     ShopBridgeDbContext.Dispose();
 }
예제 #4
0
 public UnitOfWork(ShopBridgeDbContext context)
 {
     this.context = context;
 }
예제 #5
0
 public InventoryMgmtService(ShopBridgeDbContext dbContext, ILogger <InventoryMgmtService> logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }