Exemplo n.º 1
0
 public ActionResult Index()
 {
     using (var ctx = new EyeshadowMatchContext())
     {
         List <Brand> brands = ctx.Brands.ToList();
         return(View(brands));
     }
 }
Exemplo n.º 2
0
        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
                }
            };
        }