Example #1
0
        public bool Update(T entity)
        {
            ctx.Entry(entity).State = EntityState.Modified;
            int result = ctx.SaveChanges();

            if (result > 0)
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public bool AddProductBool(Product product)
        {
            UdemyETicaretDBContext ctx = new UdemyETicaretDBContext();

            EntityState result = ctx.Entry(product).State = EntityState.Added;

            if (result != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }