private void SeedInMemoryDB(DbContextOptions <productDBContext> dbOptions) { var ctx = new productDBContext(dbOptions); var product = new DevProduct { Name = "Coding Duck", Description = "Quack quack", Amount = 9, }; var comment = new DevProductComment { Author = "Someone", Content = "Some content!", Date = "today" }; product.Comments.Add(comment); ctx.Products.Add(product); ctx.SaveChanges(); }
public ProductService(productDBContext dbContext) { _dbContext = dbContext; }