public async Task <DeleteTimeEntryResponse> DeleteTimeSheetEntry(Guid id) { var timeSheetEntry = Repository.GetById(id); if (timeSheetEntry == null) { // This can be a custom exception so that NotFound (404) could be thrown throw new Exception($"User:{id} not found"); } ; timeSheetEntry.Delete(); Repository.Delete(timeSheetEntry); await UnitOfWork.Commit(); return(new DeleteTimeEntryResponse { Success = true }); }