Beispiel #1
0
 public virtual void Delete(T entityToDelete)
 {
     if (_context.Entry(entityToDelete).State == EntityState.Detached)
     {
         _entities.Attach(entityToDelete);
     }
     _entities.Remove(entityToDelete);
 }
Beispiel #2
0
        public async Task <IActionResult> PutCalculadora(int id, Calculadora calculadora)
        {
            if (id != calculadora.IdOperacion)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }