public bool delete(Modelo prEntity) { try { Servico Entity = (Servico)prEntity; Servicos.Attach(Entity); if (Entry(Entity).State == EntityState.Detached) { Servicos.Attach(Entity); } Servicos.Remove(Entity); return(SaveChanges() > 0); } catch (Exception e) { return(false); } }
public async Task EliminarServico(Servico servico) { await servicosDAL.DeleteAsync(servico); Servicos.Remove(servico); }