public ActionResult Index() { using (var ctx = new EyeshadowMatchContext()) { List <Brand> brands = ctx.Brands.ToList(); return(View(brands)); } }
public static void EnsureSeedDataForContext(this EyeshadowMatchContext context) { var brands = new List <Brand>() { new Brand() { BrandName = "NARS" }, new Brand() { BrandName = "MAC" } }; var products = new List <Product>() { new Product() { ProductName = "", BrandId = 1, Price = 33 } }; }