public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; EntityBase.CleanUp(args); if (_getByArgsOnPreValidateAsync != null) { await _getByArgsOnPreValidateAsync(args, paging).ConfigureAwait(false); } MultiValidator.Create() .Add(args.Validate(nameof(args)).Entity(ProductArgsValidator.Default)) .Additional((__mv) => _getByArgsOnValidate?.Invoke(__mv, args, paging)) .Run().ThrowOnError(); if (_getByArgsOnBeforeAsync != null) { await _getByArgsOnBeforeAsync(args, paging).ConfigureAwait(false); } var __result = await ProductDataSvc.GetByArgsAsync(args, paging).ConfigureAwait(false); if (_getByArgsOnAfterAsync != null) { await _getByArgsOnAfterAsync(__result, args, paging).ConfigureAwait(false); } Cleaner.Clean(__result); return __result; })); }
public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) { return(DataSvcInvoker.Current.InvokeAsync(this, async() => { var __result = await _data.GetByArgsAsync(args, paging).ConfigureAwait(false); return __result; })); }
public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) { return(DataInvoker.Current.InvokeAsync(this, async() => { ProductCollectionResult __result = new ProductCollectionResult(paging); var __dataArgs = ODataMapper.Default.CreateArgs(__result.Paging !, "Products"); __result.Result = _odata.Query(__dataArgs, q => _getByArgsOnQuery?.Invoke(q, args, __dataArgs) ?? q).SelectQuery <ProductCollection>(); return await Task.FromResult(__result).ConfigureAwait(false); }));
public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(args); args.Validate(nameof(args)).Entity(ProductArgsValidator.Default).Run().ThrowOnError(); return Cleaner.Clean(await _dataService.GetByArgsAsync(args, paging).ConfigureAwait(false)); })); }
public Task<ProductCollectionResult> GetByArgsAsync(ProductArgs? args, PagingArgs? paging) { return DataInvoker.Default.InvokeAsync(this, async () => { ProductCollectionResult __result = new ProductCollectionResult(paging); var __dataArgs = ODataMapper.Default.CreateArgs(__result.Paging!); if (_getByArgsOnBeforeAsync != null) await _getByArgsOnBeforeAsync(args, __dataArgs).ConfigureAwait(false); __result.Result = await TestOData.Default.SelectQueryAsync<ProductCollection, Product>(__dataArgs, q => _getByArgsOnQuery == null ? q : _getByArgsOnQuery(q, args, __dataArgs)).ConfigureAwait(false); if (_getByArgsOnAfterAsync != null) await _getByArgsOnAfterAsync(__result, args).ConfigureAwait(false); return __result; }, new BusinessInvokerArgs { ExceptionHandler = _getByArgsOnException });
public Task <WebApiAgentResult <ProductCollectionResult> > GetByArgsAsync(ProductArgs?args, PagingArgs?paging = null, WebApiRequestOptions?requestOptions = null) => ProductServiceAgent.GetByArgsAsync(args, paging, requestOptions);
public Task <WebApiAgentResult <ProductCollectionResult> > GetByArgsAsync(ProductArgs?args, PagingArgs?paging = null, WebApiRequestOptions?requestOptions = null) { return(base.GetCollectionResultAsync <ProductCollectionResult, ProductCollection, Product>("api/v1/products", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg <ProductArgs?>("args", args, WebApiArgType.FromUriUseProperties), new WebApiPagingArgsArg("paging", paging) })); }
public async Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) => await ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(args); await args.Validate(nameof(args)).Entity().With <IValidator <ProductArgs> >().RunAsync(throwOnError: true).ConfigureAwait(false); return(Cleaner.Clean(await _dataService.GetByArgsAsync(args, paging).ConfigureAwait(false))); }, BusinessInvokerArgs.Read).ConfigureAwait(false);
public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) => DataInvoker.Current.InvokeAsync(this, async() => {