Exemplo n.º 1
0
        public string TestInsert()
        {
            var db = new FabricsEntities();

            db.Product.Add(new Product()
            {
                ProductName = "Entity Framework",
                Price = 99,
                Stock = 10,
                Active = true
            });

            db.SaveChanges();

            return "OK";
        }
Exemplo n.º 2
0
        public string TestInsert()
        {
            var db = new FabricsEntities();
            var prod = new Product()
            {
                ProductName = "EF",
                Price = 99,
                Stock = 5,
                Active = true
            };
            db.Product.Add(prod);

            db.SaveChanges();

            return "OK: "+prod.ProductId;
        }