public static void Seed(this kwooncjpContext dbContext) { // Add entities for DbContext instance dbContext.Productinfos.Add(new Productinfos { Id = 1, Productname = "Test", Unitprice = 1 }); }
public static kwooncjpContext GetWideWorldImportersDbContext(string dbName) { // Create options for DbContext instance var options = new DbContextOptionsBuilder <kwooncjpContext>() .UseInMemoryDatabase(databaseName: dbName) .Options; // Create instance of DbContext var dbContext = new kwooncjpContext(options); // Add entities in memory dbContext.Seed(); return(dbContext); }
public ProductsRespository(kwooncjpContext context, IMapper mapper) : base(context) { _mapper = mapper; }
public BaseRepository(kwooncjpContext context) { _context = context; }