예제 #1
0
        public Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?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(RobotArgsValidator.Default))
                .Additional((__mv) => _getByArgsOnValidate?.Invoke(__mv, args, paging))
                .Run().ThrowOnError();

                if (_getByArgsOnBeforeAsync != null)
                {
                    await _getByArgsOnBeforeAsync(args, paging).ConfigureAwait(false);
                }
                var __result = await RobotDataSvc.GetByArgsAsync(args, paging).ConfigureAwait(false);
                if (_getByArgsOnAfterAsync != null)
                {
                    await _getByArgsOnAfterAsync(__result, args, paging).ConfigureAwait(false);
                }
                Cleaner.Clean(__result);
                return __result;
            }));
        }
예제 #2
0
 public Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?args, PagingArgs?paging)
 {
     return(DataInvoker.Current.InvokeAsync(this, async() =>
     {
         RobotCollectionResult __result = new RobotCollectionResult(paging);
         var __dataArgs = CosmosMapper.Default.CreateArgs("Items", __result.Paging !, PartitionKey.None, onCreate: _onDataArgsCreate);
         __result.Result = _cosmos.Container(__dataArgs).Query(q => _getByArgsOnQuery?.Invoke(q, args, __dataArgs) ?? q).SelectQuery <RobotCollection>();
         return await Task.FromResult(__result).ConfigureAwait(false);
     }));
예제 #3
0
        public Task <GrpcAgentResult <RobotCollectionResult> > GetByArgsAsync(RobotArgs?args, PagingArgs?paging = null, GrpcRequestOptions?requestOptions = null)
        {
            var __req = new proto.RobotGetByArgsRequest {
                Args = Transformers.RobotArgs.MapToDest(args), Paging = Transformers.PagingArgsToPagingArgsConverter.ConvertToDest(paging !)
            };

            return(InvokeAsync((c, o) => c.GetByArgsAsync(__req, o), __req, Transformers.RobotCollectionResult, requestOptions));
        }
    }
예제 #4
0
 public Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?args, PagingArgs?paging)
 {
     return(ManagerInvoker.Current.InvokeAsync(this, async() =>
     {
         ExecutionContext.Current.OperationType = OperationType.Read;
         Cleaner.CleanUp(args);
         args.Validate(nameof(args)).Entity(RobotArgsValidator.Default).Run().ThrowOnError();
         return Cleaner.Clean(await _dataService.GetByArgsAsync(args, paging).ConfigureAwait(false));
     }));
 }
예제 #5
0
 public Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?args, PagingArgs?paging)
 {
     return(DataInvoker.Default.InvokeAsync(this, async() =>
     {
         RobotCollectionResult __result = new RobotCollectionResult(paging);
         var __dataArgs = CosmosMapper.Default.CreateArgs("Items", __result.Paging !, PartitionKey.None);
         _onDataArgsCreate?.Invoke(__dataArgs);
         if (_getByArgsOnBeforeAsync != null)
         {
             await _getByArgsOnBeforeAsync(args, __dataArgs).ConfigureAwait(false);
         }
         __result.Result = CosmosDb.Default.Container(__dataArgs).Query(q => _getByArgsOnQuery == null ? q : _getByArgsOnQuery(q, args, __dataArgs)).SelectQuery <RobotCollection>();
         if (_getByArgsOnAfterAsync != null)
         {
             await _getByArgsOnAfterAsync(__result, args).ConfigureAwait(false);
         }
         return __result;
     }, new BusinessInvokerArgs {
예제 #6
0
 public Task <WebApiAgentResult <RobotCollectionResult> > GetByArgsAsync(RobotArgs?args, PagingArgs?paging = null, WebApiRequestOptions?requestOptions = null)
 => RobotServiceAgent.GetByArgsAsync(args, paging, requestOptions);
예제 #7
0
파일: RobotData.cs 프로젝트: Avanade/Beef
 public Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?args, PagingArgs?paging) => DataInvoker.Current.InvokeAsync(this, async() =>
 {
예제 #8
0
 public Task <WebApiAgentResult <RobotCollectionResult> > GetByArgsAsync(RobotArgs?args, PagingArgs?paging = null, WebApiRequestOptions?requestOptions = null)
 {
     return(base.GetCollectionResultAsync <RobotCollectionResult, RobotCollection, Robot>("api/v1/robots", requestOptions: requestOptions,
                                                                                          args: new WebApiArg[] { new WebApiArg <RobotArgs?>("args", args, WebApiArgType.FromUriUseProperties), new WebApiPagingArgsArg("paging", paging) }));
 }
예제 #9
0
파일: RobotManager.cs 프로젝트: ostat/Beef
 public async Task <RobotCollectionResult> GetByArgsAsync(RobotArgs?args, PagingArgs?paging) => await ManagerInvoker.Current.InvokeAsync(this, async() =>
 {
     Cleaner.CleanUp(args);
     await args.Validate(nameof(args)).Entity().With <IValidator <RobotArgs> >().RunAsync(throwOnError: true).ConfigureAwait(false);
     return(Cleaner.Clean(await _dataService.GetByArgsAsync(args, paging).ConfigureAwait(false)));
 }, BusinessInvokerArgs.Read).ConfigureAwait(false);