コード例 #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
 private EntityEntry <TEntity> NewMethod(TEntity model)
 {
     return(_context.Entry(model));
 }