public void printElements() { using (var context = new Recipies()) { foreach (var p in context.Products) { Console.WriteLine("{0} {1} {2} {3}", p.SKU, p.Description, p.Price.ToString("C"), p.ImageURL); } } }
public void addElement(int sku, string description, decimal price, string imageURL) { using (var context = new Recipies()) { var product = new Product { SKU = sku, Description = description, ImageURL = imageURL, Price = price }; context.Products.Add(product); context.SaveChanges(); } }