コード例 #1
0
        public async Task <IActionResult> PutEvento(int id, Evento evento)
        {
            if (id != evento.EventoId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
 public async Task <int> SaveAsync()
 {
     try
     {
         return(await _context.SaveChangesAsync());
     }
     catch (Exception)
     {
         throw;
     }
 }