Пример #1
0
        public async Task <IActionResult> PutAccountPlan(int id, AccountPlan accountPlan)
        {
            if (id != accountPlan.ID)
            {
                return(BadRequest());
            }

            _context.Entry(accountPlan).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AccountPlanExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        public async Task <IActionResult> PutDeal(int id, Deal deal)
        {
            if (id != deal.ID)
            {
                return(BadRequest());
            }

            _context.Entry(deal).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DealExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }