protected DbContextTestInstance() { _connection = new SqliteConnection(InMemoryConnectionString); _connection.Open(); var options = new DbContextOptionsBuilder <GameShopDbContext>() .UseSqlite(_connection) .Options; DbContext = new GameShopDbContext(options); DbContext.Database.EnsureCreated(); }
public ProductService(GameShopDbContext gameShopDbContext, IMapper mapper) { this.gameShopDbContext = gameShopDbContext; this.mapper = mapper; products = gameShopDbContext.Set <Product>(); }