//—————————————————————————————————————————————————————[ ELIMINAR ]————————————————————————————————————————————————————— public static bool Eliminar(int id) { bool paso = false; Contexto contexto = new Contexto(); try { var devolucion = VentasBLL.Buscar(id); if (devolucion != null) { contexto.Ventas.Remove(devolucion); paso = contexto.SaveChanges() > 0; } } catch (Exception) { throw; } finally { contexto.Dispose(); } return(paso); }
public static bool Eliminar(int id) { Contexto db = new Contexto(); bool paso = false; try { var Eliminar = VentasBLL.Buscar(id); db.Entry(Eliminar).State = EntityState.Deleted; paso = db.SaveChanges() > 0; } catch (Exception) { throw; } finally { db.Dispose(); } return(paso); }