Exemple #1
0
 public void AddProduct(Product product)
 {
     using (VenusKuaforContext context = new VenusKuaforContext())
     {
         context.Products.Add(product);
         context.SaveChanges();
     }
 }
Exemple #2
0
        public List <Product> GetAllProducts()
        {
            VenusKuaforContext contextcon = new VenusKuaforContext();

            if ((contextcon.Database.Connection.State & ConnectionState.Open) != 0)
            {
                MessageBox.Show("bağlantı is ok");
            }
            else
            {
                MessageBox.Show("bağlantı is YOK");
            }
            ;
            using (VenusKuaforContext context = new VenusKuaforContext())
            {
                return(context.Products.ToList());
            }
        }