public Task <PersonCollectionResult> GetAllAsync(PagingArgs?paging) { return(DataInvoker.Current.InvokeAsync(this, async() => { PersonCollectionResult __result = new PersonCollectionResult(paging); var __dataArgs = DbMapper.Default.CreateArgs("[Demo].[spPersonGetAll]", __result.Paging !); if (_getAllOnBeforeAsync != null) { await _getAllOnBeforeAsync(__dataArgs).ConfigureAwait(false); } __result.Result = await _db.Query(__dataArgs, p => _getAllOnQuery?.Invoke(p, __dataArgs)).SelectQueryAsync <PersonCollection>().ConfigureAwait(false); if (_getAllOnAfterAsync != null) { await _getAllOnAfterAsync(__result).ConfigureAwait(false); } return __result; }, new BusinessInvokerArgs {
/// <summary> /// Gets the <see cref="Person"/> collection object that matches the selection criteria. /// </summary> /// <param name="args">The Args (see <see cref="PersonArgs"/>).</param> /// <param name="paging">The <see cref="PagingArgs"/>.</param> /// <returns>A <see cref="PersonCollectionResult"/>.</returns> public Task <PersonCollectionResult> GetByArgsWithEfAsync(PersonArgs args, PagingArgs paging) { return(DataInvoker.Default.InvokeAsync(this, async() => { PersonCollectionResult __result = new PersonCollectionResult(paging); var __dataArgs = EfMapper.Default.CreateArgs(__result.Paging); if (_getByArgsWithEfOnBeforeAsync != null) { await _getByArgsWithEfOnBeforeAsync(args, __dataArgs).ConfigureAwait(false); } __result.Result = EfDb.Default.Query(__dataArgs, q => _getByArgsWithEfOnQuery == null ? q : _getByArgsWithEfOnQuery(q, args, __dataArgs)).SelectQuery <PersonCollection>(); if (_getByArgsWithEfOnAfterAsync != null) { await _getByArgsWithEfOnAfterAsync(__result, args).ConfigureAwait(false); } return __result; }, new BusinessInvokerArgs { ExceptionHandler = _getByArgsWithEfOnException })); }
/// <summary> /// Gets the <see cref="Person"/> collection object that matches the selection criteria. /// </summary> /// <param name="args">The Args (see <see cref="PersonArgs"/>).</param> /// <param name="paging">The <see cref="PagingArgs"/>.</param> /// <returns>A <see cref="PersonCollectionResult"/>.</returns> public Task <PersonCollectionResult> GetByArgsAsync(PersonArgs args, PagingArgs paging) { return(DataInvoker.Default.InvokeAsync(this, async() => { PersonCollectionResult __result = new PersonCollectionResult(paging); var __dataArgs = DbMapper.Default.CreateArgs("[Demo].[spPersonGetByArgs]", __result.Paging); if (_getByArgsOnBeforeAsync != null) { await _getByArgsOnBeforeAsync(args, __dataArgs).ConfigureAwait(false); } __result.Result = Database.Default.Query(__dataArgs, p => _getByArgsOnQuery?.Invoke(p, args, __dataArgs)).SelectQuery <PersonCollection>(); if (_getByArgsOnAfterAsync != null) { await _getByArgsOnAfterAsync(__result, args).ConfigureAwait(false); } return __result; }, new BusinessInvokerArgs { ExceptionHandler = _getByArgsOnException })); }
/// <summary> /// Gets the <see cref="Person"/> collection object that matches the selection criteria. /// </summary> /// <returns>A <see cref="PersonCollectionResult"/>.</returns> public Task <PersonCollectionResult> GetAll2Async() { return(DataInvoker.Default.InvokeAsync(this, async() => { PersonCollectionResult __result = new PersonCollectionResult(); var __dataArgs = DbMapper.Default.CreateArgs("[Demo].[spPersonGetAll]"); if (_getAll2OnBeforeAsync != null) { await _getAll2OnBeforeAsync(__dataArgs); } __result.Result = Database.Default.Query(__dataArgs, p => _getAll2OnQuery?.Invoke(p, __dataArgs)).SelectQuery <PersonCollection>(); if (_getAll2OnAfterAsync != null) { await _getAll2OnAfterAsync(__result); } return __result; }, new BusinessInvokerArgs { ExceptionHandler = _getAll2OnException })); }