public Task DeleteAsync(Guid id)
 {
     return(ManagerInvoker.Current.InvokeAsync(this, async() =>
     {
         ExecutionContext.Current.OperationType = OperationType.Delete;
         Cleaner.CleanUp(id);
         id.Validate(nameof(id)).Mandatory().Common(EmployeeValidator.CanDelete).Run().ThrowOnError();
         await _dataService.DeleteAsync(id).ConfigureAwait(false);
     }));
 }
Exemple #2
0
 public async Task DeleteAsync(Guid id) => await ManagerInvoker.Current.InvokeAsync(this, async() =>
 {
     Cleaner.CleanUp(id);
     await id.Validate(nameof(id)).Mandatory().Common(EmployeeValidator.CanDelete).RunAsync(throwOnError: true).ConfigureAwait(false);
     await _dataService.DeleteAsync(id).ConfigureAwait(false);
 }, BusinessInvokerArgs.Delete).ConfigureAwait(false);