public void Delete(int id) { using (var context = new ProjetoContext(_optionsBuilder.Options)) { var entidade = context.Set <T>().Find(id); context.Remove(entidade); context.SaveChanges(); } }
public void Excluir(int tarefaId) { _tarefaRepository.Remove(_tarefaRepository.Tarefas.Find(tarefaId)); _tarefaRepository.SaveChanges(); }