public Task <PersonCollectionResult> GetAll2Async()
        {
            return(ManagerInvoker.Current.InvokeAsync(this, async() =>
            {
                ExecutionContext.Current.OperationType = OperationType.Read;
                if (_getAll2OnPreValidateAsync != null)
                {
                    await _getAll2OnPreValidateAsync().ConfigureAwait(false);
                }

                MultiValidator.Create()
                .Additional((__mv) => _getAll2OnValidate?.Invoke(__mv))
                .Run().ThrowOnError();

                if (_getAll2OnBeforeAsync != null)
                {
                    await _getAll2OnBeforeAsync().ConfigureAwait(false);
                }
                var __result = await _dataService.GetAll2Async().ConfigureAwait(false);
                if (_getAll2OnAfterAsync != null)
                {
                    await _getAll2OnAfterAsync(__result).ConfigureAwait(false);
                }
                return Cleaner.Clean(__result);
            }));
        }
Beispiel #2
0
        public Task <PersonCollectionResult> GetAll2Async() => ManagerInvoker.Current.InvokeAsync(this, async() =>
        {
            await(_getAll2OnPreValidateAsync?.Invoke() ?? Task.CompletedTask).ConfigureAwait(false);

            await MultiValidator.Create()
            .Additional((__mv) => _getAll2OnValidate?.Invoke(__mv))
            .RunAsync(throwOnError: true).ConfigureAwait(false);

            await(_getAll2OnBeforeAsync?.Invoke() ?? Task.CompletedTask).ConfigureAwait(false);
            var __result = await _dataService.GetAll2Async().ConfigureAwait(false);
            await(_getAll2OnAfterAsync?.Invoke(__result) ?? Task.CompletedTask).ConfigureAwait(false);
            return(Cleaner.Clean(__result));
        }, BusinessInvokerArgs.Read);
Beispiel #3
0
 public Task <PersonCollectionResult> GetAll2Async()
 {
     return(ManagerInvoker.Current.InvokeAsync(this, async() =>
     {
         ExecutionContext.Current.OperationType = OperationType.Read;
         if (_getAll2OnBeforeAsync != null)
         {
             await _getAll2OnBeforeAsync().ConfigureAwait(false);
         }
         var __result = await _dataService.GetAll2Async().ConfigureAwait(false);
         if (_getAll2OnAfterAsync != null)
         {
             await _getAll2OnAfterAsync(__result).ConfigureAwait(false);
         }
         return Cleaner.Clean(__result);
     }));
 }