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

                MultiValidator.Create()
                .Additional((__mv) => _getAllOnValidate?.Invoke(__mv, paging))
                .Run().ThrowOnError();

                if (_getAllOnBeforeAsync != null)
                {
                    await _getAllOnBeforeAsync(paging).ConfigureAwait(false);
                }
                var __result = await _dataService.GetAllAsync(paging).ConfigureAwait(false);
                if (_getAllOnAfterAsync != null)
                {
                    await _getAllOnAfterAsync(__result, paging).ConfigureAwait(false);
                }
                return Cleaner.Clean(__result);
            }));
        }
Beispiel #2
0
        public Task <PersonCollectionResult> GetAllAsync(PagingArgs?paging) => ManagerInvoker.Current.InvokeAsync(this, async() =>
        {
            await(_getAllOnPreValidateAsync?.Invoke(paging) ?? Task.CompletedTask).ConfigureAwait(false);

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

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