async Task ITimeEntryService.DeleteTimeEntry(DeleteTimeEntryCommand command) { var currentPrincipal = await currentUserResolver.ResolveCurrentClaimsPrincipalAsync(); await authorizationService.AuthorizeResourceType(currentPrincipal, Operation.Delete, typeof(TimeEntry)); Check.NotNull(command, errorMessage: "Command can not be null."); await validationService.Validate(command); var existingTimeEntry = await timeEntryRepository.GetTimeEntryById(command.TimeEntryId); if (existingTimeEntry == null) { return; } await authorizationService.AuthorizeResource(currentPrincipal, Operation.Delete, existingTimeEntry); await timeEntryRepository.DeleteTimeEntry(existingTimeEntry); }