Esempio n. 1
0
        public static void SeedDB(WatchAppDbContext ctx)
        {
            ctx.Database.EnsureCreated();

            /*var watch1 = ctx.Watches.Add(new Watches()
             * {
             *  ProductName = "Rolex",
             *  ProductDescription ="Expensive as shizzle",
             *  Stock = 2,
             *  Price = 500,
             *  ProductPicture = "wow.jpeg"
             * }).Entity;*/
            ctx.SaveChanges();
        }
Esempio n. 2
0
 public Watches CreateWatch(Watches watches)
 {
     _ctx.Attach(watches).State = EntityState.Added;
     _ctx.SaveChanges();
     return(watches);
 }