예제 #1
0
        public async Task <int> PutCustomer(int id, Customer customer)
        {
            db.Entry(customer).State = EntityState.Modified;

            try
            {
                return(await db.SaveChangesAsync());
            }
            catch (DbUpdateConcurrencyException)
            {
                return(0);
            }
        }
예제 #2
0
        public async Task <int> PutProduct(int id, Product product)
        {
            db.Entry(product).State = EntityState.Modified;

            try
            {
                return(await db.SaveChangesAsync());
            }
            catch (DbUpdateConcurrencyException)
            {
                return(0);
            }
        }