public ActionResult Delete(int id) { var model = _repository.GetCommandById(id); if (model == null) { return(NotFound()); } _repository.Delete(model); _repository.SaveChanges(); return(NoContent()); }
public bool Delete(int id, out CategoryReadModel deletedCategory) { var foundCategory = _repository.LookupCategory(id); if (foundCategory == null) { deletedCategory = null; return(false); } _repository.Delete(foundCategory); _repository.SaveChanges(); deletedCategory = _mapper.Map <CategoryReadModel>(foundCategory); return(true); }
public void Delete(CommandModel command) { _repository.Delete(command); }