public async Task <IActionResult> PutPayMethod(int id, PayMethod payMethod)
        {
            if (id != payMethod.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeleteCategory(int id)
        {
            var category = await _context.Categories.FindAsync(id);

            if (category == null)
            {
                return(NotFound());
            }

            _context.Categories.Remove(category);
            await _context.SaveChangesAsync();

            return(NoContent());
        }
Exemplo n.º 3
0
 public async Task <int> SaveChanges()
 {
     return(await dinExContext.SaveChangesAsync());
 }