public void Insert(ProductMetal item) { ProductMetal newItem = new ProductMetal() { Name = item.Name, IsDeleted = false }; _context.ProductMetal.Add(newItem); _context.SaveChanges(); }
public void Update(ProductMetal modifiedItem) { _repository.Update(modifiedItem); }
public void Insert(ProductMetal item) { _repository.Insert(item); }
public IEnumerable <Product> GetByProductMetal(ProductMetal productMetal) { throw new System.NotImplementedException(); }
public void Update(ProductMetal modifiedItem) { _context.ProductMetal.Update(modifiedItem); _context.SaveChanges(); }
public static void Initialize(WebStoreDbContext context) { context.Database.EnsureCreated(); if (!context.Product.Any()) { var deps = new Product[] { new Product() { Name = "Product 01" }, new Product() { Name = "Product 02" } }; foreach (var item in deps) { context.Product.Add(item); } context.SaveChanges(); } if (!context.ProductStatus.Any()) { var companies = new ProductStatus[] { new ProductStatus() { Name = "New" } }; foreach (var item in companies) { context.ProductStatus.Add(item); } context.SaveChanges(); } if (!context.ProductAvailabilityStatus.Any()) { var companies = new ProductAvailabilityStatus[] { new ProductAvailabilityStatus() { Name = "Available" }, new ProductAvailabilityStatus() { Name = "Not Available" } }; foreach (var item in companies) { context.ProductAvailabilityStatus.Add(item); } context.SaveChanges(); } if (!context.ProductColor.Any()) { var companies = new ProductColor[] { new ProductColor() { Name = "White" }, new ProductColor() { Name = "Black" } }; foreach (var item in companies) { context.ProductColor.Add(item); } context.SaveChanges(); } if (!context.ProductMetal.Any()) { var companies = new ProductMetal[] { new ProductMetal() { Name = "Gold" }, new ProductMetal() { Name = "Silver" } }; foreach (var item in companies) { context.ProductMetal.Add(item); } context.SaveChanges(); } if (!context.ProductType.Any()) { var types = new ProductType[] { new ProductType() { Name = "Ring" }, new ProductType() { Name = "Earring" } }; foreach (var item in types) { context.ProductType.Add(item); } context.SaveChanges(); } if (!context.Gender.Any()) { var items = new Gender[] { new Gender() { Name = "Чоловіча" }, new Gender() { Name = "Жіноча" } }; foreach (var item in items) { context.Gender.Add(item); } context.SaveChanges(); } }