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); })); }
/// <summary> /// Updates the <see cref="Robot"/> object. /// </summary> /// <param name="value">The <see cref="Robot"/> object.</param> /// <param name="id">The <see cref="Robot"/> identifier.</param> /// <returns>A refreshed <see cref="Robot"/> object.</returns> public Task <Robot> UpdateAsync(Robot value, Guid id) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; if (value != null) { value.Id = id; } EntityBase.CleanUp(value, id); if (_updateOnPreValidateAsync != null) { await _updateOnPreValidateAsync(value, id); } MultiValidator.Create() .Add(value.Validate(nameof(value)).Mandatory().Entity(RobotValidator.Default)) .Additional((__mv) => _updateOnValidate?.Invoke(__mv, value, id)) .Run().ThrowOnError(); if (_updateOnBeforeAsync != null) { await _updateOnBeforeAsync(value, id); } var __result = await RobotDataSvc.UpdateAsync(value); if (_updateOnAfterAsync != null) { await _updateOnAfterAsync(__result, id); } Cleaner.Clean(__result); return __result; })); }
/// <summary> /// Deletes the <see cref="CustomerGroup"/> object. /// </summary> /// <param name="id">The <see cref="CustomerGroup"/> identifier.</param> /// <param name="company">The Company (see <see cref="RefDataNamespace.Company"/>).</param> public Task DeleteAsync(string id, RefDataNamespace.Company company) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Delete; EntityBase.CleanUp(id); if (_deleteOnPreValidateAsync != null) { await _deleteOnPreValidateAsync(id, company).ConfigureAwait(false); } MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Add(company.Validate(nameof(company)).Mandatory().IsValid()) .Additional((__mv) => _deleteOnValidate?.Invoke(__mv, id, company)) .Run().ThrowOnError(); if (_deleteOnBeforeAsync != null) { await _deleteOnBeforeAsync(id, company).ConfigureAwait(false); } await CustomerGroupDataSvc.DeleteAsync(id, company).ConfigureAwait(false); if (_deleteOnAfterAsync != null) { await _deleteOnAfterAsync(id, company).ConfigureAwait(false); } })); }
public Task <Person> MergeAsync(Guid fromId, Guid toId) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; Cleaner.CleanUp(fromId, toId); if (_mergeOnPreValidateAsync != null) { await _mergeOnPreValidateAsync(fromId, toId).ConfigureAwait(false); } MultiValidator.Create() .Add(fromId.Validate(nameof(fromId)).Mandatory()) .Add(toId.Validate(nameof(toId)).Mandatory().CompareValue(CompareOperator.NotEqual, fromId, nameof(fromId).ToSentenceCase() !)) .Additional((__mv) => _mergeOnValidate?.Invoke(__mv, fromId, toId)) .Run().ThrowOnError(); if (_mergeOnBeforeAsync != null) { await _mergeOnBeforeAsync(fromId, toId).ConfigureAwait(false); } var __result = await _dataService.MergeAsync(fromId, toId).ConfigureAwait(false); if (_mergeOnAfterAsync != null) { await _mergeOnAfterAsync(__result, fromId, toId).ConfigureAwait(false); } return Cleaner.Clean(__result); }));
/// <summary> /// Creates the <see cref="Gender"/> object. /// </summary> /// <param name="value">The <see cref="Gender"/> object.</param> /// <returns>A refreshed <see cref="Gender"/> object.</returns> public Task <Gender> CreateAsync(Gender value) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Create; EntityBase.CleanUp(value); if (_createOnPreValidateAsync != null) { await _createOnPreValidateAsync(value).ConfigureAwait(false); } MultiValidator.Create() .Add(value.Validate(nameof(value)).Mandatory().Entity(new ReferenceDataValidator <Gender>())) .Additional((__mv) => _createOnValidate?.Invoke(__mv, value)) .Run().ThrowOnError(); if (_createOnBeforeAsync != null) { await _createOnBeforeAsync(value).ConfigureAwait(false); } var __result = await GenderDataSvc.CreateAsync(value).ConfigureAwait(false); if (_createOnAfterAsync != null) { await _createOnAfterAsync(__result).ConfigureAwait(false); } Cleaner.Clean(__result); return __result; })); }
public Task <PersonDetailCollectionResult> GetDetailByArgsAsync(PersonArgs?args, PagingArgs?paging) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(args); if (_getDetailByArgsOnPreValidateAsync != null) { await _getDetailByArgsOnPreValidateAsync(args, paging).ConfigureAwait(false); } MultiValidator.Create() .Add(args.Validate(nameof(args)).Entity(PersonArgsValidator.Default)) .Additional((__mv) => _getDetailByArgsOnValidate?.Invoke(__mv, args, paging)) .Run().ThrowOnError(); if (_getDetailByArgsOnBeforeAsync != null) { await _getDetailByArgsOnBeforeAsync(args, paging).ConfigureAwait(false); } var __result = await _dataService.GetDetailByArgsAsync(args, paging).ConfigureAwait(false); if (_getDetailByArgsOnAfterAsync != null) { await _getDetailByArgsOnAfterAsync(__result, args, paging).ConfigureAwait(false); } return Cleaner.Clean(__result); })); }
public Task <TransactionCollectionResult> GetTransactionsAsync(string?accountId, TransactionArgs?args, PagingArgs?paging) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; EntityBase.CleanUp(accountId, args); if (_getTransactionsOnPreValidateAsync != null) { await _getTransactionsOnPreValidateAsync(accountId, args, paging).ConfigureAwait(false); } MultiValidator.Create() .Add(accountId.Validate(nameof(accountId)).Mandatory().Common(Validators.AccountId)) .Add(args.Validate(nameof(args)).Entity(TransactionArgsValidator.Default)) .Additional((__mv) => _getTransactionsOnValidate?.Invoke(__mv, accountId, args, paging)) .Run().ThrowOnError(); if (_getTransactionsOnBeforeAsync != null) { await _getTransactionsOnBeforeAsync(accountId, args, paging).ConfigureAwait(false); } var __result = await TransactionDataSvc.GetTransactionsAsync(accountId, args, paging).ConfigureAwait(false); if (_getTransactionsOnAfterAsync != null) { await _getTransactionsOnAfterAsync(__result, accountId, args, paging).ConfigureAwait(false); } Cleaner.Clean(__result); return __result; })); }
/// <summary> /// Deletes the <see cref="Robot"/> object. /// </summary> /// <param name="id">The <see cref="Robot"/> identifier.</param> public Task DeleteAsync(Guid id) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Delete; EntityBase.CleanUp(id); if (_deleteOnPreValidateAsync != null) { await _deleteOnPreValidateAsync(id); } MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Additional((__mv) => _deleteOnValidate?.Invoke(__mv, id)) .Run().ThrowOnError(); if (_deleteOnBeforeAsync != null) { await _deleteOnBeforeAsync(id); } await RobotDataSvc.DeleteAsync(id); if (_deleteOnAfterAsync != null) { await _deleteOnAfterAsync(id); } })); }
#pragma warning restore CS0649 #endregion /// <summary> /// Gets the <see cref="Gender"/> object that matches the selection criteria. /// </summary> /// <param name="id">The <see cref="Gender"/> identifier.</param> /// <returns>The selected <see cref="Gender"/> object where found; otherwise, <c>null</c>.</returns> public Task <Gender> GetAsync(Guid id) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; EntityBase.CleanUp(id); if (_getOnPreValidateAsync != null) { await _getOnPreValidateAsync(id).ConfigureAwait(false); } MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Additional((__mv) => _getOnValidate?.Invoke(__mv, id)) .Run().ThrowOnError(); if (_getOnBeforeAsync != null) { await _getOnBeforeAsync(id).ConfigureAwait(false); } var __result = await GenderDataSvc.GetAsync(id).ConfigureAwait(false); if (_getOnAfterAsync != null) { await _getOnAfterAsync(__result, id).ConfigureAwait(false); } Cleaner.Clean(__result); return __result; })); }
public Task <TripPerson> UpdateAsync(TripPerson value, string?id) { value.Validate(nameof(value)).Mandatory().Run().ThrowOnError(); return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; value.Id = id; EntityBase.CleanUp(value, id); if (_updateOnPreValidateAsync != null) { await _updateOnPreValidateAsync(value, id).ConfigureAwait(false); } MultiValidator.Create() .Add(value.Validate(nameof(value))) .Additional((__mv) => _updateOnValidate?.Invoke(__mv, value, id)) .Run().ThrowOnError(); if (_updateOnBeforeAsync != null) { await _updateOnBeforeAsync(value, id).ConfigureAwait(false); } var __result = await TripPersonDataSvc.UpdateAsync(value).ConfigureAwait(false); if (_updateOnAfterAsync != null) { await _updateOnAfterAsync(__result, id).ConfigureAwait(false); } Cleaner.Clean(__result); return __result; })); }
/// <summary> /// Gets the <see cref="CustomerGroup"/> object that matches the selection criteria. /// </summary> /// <param name="id">The <see cref="CustomerGroup"/> identifier.</param> /// <param name="company">The Company (see <see cref="RefDataNamespace.Company"/>).</param> /// <returns>The selected <see cref="CustomerGroup"/> object where found; otherwise, <c>null</c>.</returns> public Task <CustomerGroup> GetAsync(string id, RefDataNamespace.Company company) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; EntityBase.CleanUp(id); if (_getOnPreValidateAsync != null) { await _getOnPreValidateAsync(id, company); } MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Add(company.Validate(nameof(company)).Mandatory().IsValid()) .Additional((__mv) => _getOnValidate?.Invoke(__mv, id, company)) .Run().ThrowOnError(); if (_getOnBeforeAsync != null) { await _getOnBeforeAsync(id, company); } var __result = await CustomerGroupDataSvc.GetAsync(id, company); if (_getOnAfterAsync != null) { await _getOnAfterAsync(__result, id, company); } Cleaner.Clean(__result); return __result; })); }
/// <summary> /// Upserts a <see cref="CustomerGroupCollection"/> as a batch. /// </summary> /// <param name="value">The Value (see <see cref="CustomerGroupCollection"/>).</param> /// <param name="company">The Company (see <see cref="RefDataNamespace.Company"/>).</param> public Task UpdateBatchAsync(CustomerGroupCollection value, RefDataNamespace.Company company) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Unspecified; if (value != null) { value?.ForEach(__item => __item.Company = company); } EntityBase.CleanUp(value); if (_updateBatchOnPreValidateAsync != null) { await _updateBatchOnPreValidateAsync(value, company); } MultiValidator.Create() .Add(value.Validate(nameof(value)).Mandatory().Collection(minCount: 1, maxCount: 1, item: new Beef.Validation.Rules.CollectionRuleItem <CustomerGroup>(CustomerGroupValidator.Default))) .Add(company.Validate(nameof(company)).Mandatory().IsValid()) .Additional((__mv) => _updateBatchOnValidate?.Invoke(__mv, value, company)) .Run().ThrowOnError(); if (_updateBatchOnBeforeAsync != null) { await _updateBatchOnBeforeAsync(value, company); } await CustomerGroupDataSvc.UpdateBatchAsync(value); if (_updateBatchOnAfterAsync != null) { await _updateBatchOnAfterAsync(value, company); } })); }
/// <summary> /// Updates the <see cref="CustomerGroup"/> object. /// </summary> /// <param name="value">The <see cref="CustomerGroup"/> object.</param> /// <param name="id">The <see cref="CustomerGroup"/> identifier.</param> /// <param name="company">The Company (see <see cref="RefDataNamespace.Company"/>).</param> /// <returns>A refreshed <see cref="CustomerGroup"/> object.</returns> public Task <CustomerGroup> UpdateAsync(CustomerGroup value, string id, RefDataNamespace.Company company) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; if (value != null) { value.Id = id; value.Company = company; } EntityBase.CleanUp(value, id); if (_updateOnPreValidateAsync != null) { await _updateOnPreValidateAsync(value, id, company); } MultiValidator.Create() .Add(value.Validate(nameof(value)).Mandatory().Entity(CustomerGroupValidator.Default)) .Add(company.Validate(nameof(company)).IsValid()) .Additional((__mv) => _updateOnValidate?.Invoke(__mv, value, id, company)) .Run().ThrowOnError(); if (_updateOnBeforeAsync != null) { await _updateOnBeforeAsync(value, id, company); } var __result = await CustomerGroupDataSvc.UpdateAsync(value); if (_updateOnAfterAsync != null) { await _updateOnAfterAsync(__result, id, company); } Cleaner.Clean(__result); return __result; })); }
/// <summary> /// Gets the <see cref="Robot"/> collection object that matches the selection criteria. /// </summary> /// <param name="args">The Args (see <see cref="RobotArgs"/>).</param> /// <param name="paging">The <see cref="PagingArgs"/>.</param> /// <returns>A <see cref="RobotCollectionResult"/>.</returns> 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); } 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); } var __result = await RobotDataSvc.GetByArgsAsync(args, paging); if (_getByArgsOnAfterAsync != null) { await _getByArgsOnAfterAsync(__result, args, paging); } Cleaner.Clean(__result); return __result; })); }
public Task <Person> CreateAsync(Person value) { value.Validate(nameof(value)).Mandatory().Run().ThrowOnError(); return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Create; Cleaner.CleanUp(value); if (_createOnPreValidateAsync != null) { await _createOnPreValidateAsync(value).ConfigureAwait(false); } MultiValidator.Create() .Add(value.Validate(nameof(value)).Entity(PersonValidator.Default)) .Additional((__mv) => _createOnValidate?.Invoke(__mv, value)) .Run().ThrowOnError(); if (_createOnBeforeAsync != null) { await _createOnBeforeAsync(value).ConfigureAwait(false); } var __result = await _dataService.CreateAsync(value).ConfigureAwait(false); if (_createOnAfterAsync != null) { await _createOnAfterAsync(__result).ConfigureAwait(false); } return Cleaner.Clean(__result); })); }
public Task <Person?> GetAsync(Guid id) => ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(id); await MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .RunAsync(throwOnError: true).ConfigureAwait(false); return(Cleaner.Clean(await _dataService.GetAsync(id).ConfigureAwait(false))); }, BusinessInvokerArgs.Read);
public async Task <TransactionCollectionResult> GetTransactionsAsync(string?accountId, TransactionArgs?args, PagingArgs?paging) => await ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(accountId, args); await MultiValidator.Create() .Add(accountId.Validate(nameof(accountId)).Mandatory().Common(Validators.AccountId)) .Add(args.Validate(nameof(args)).Entity().With <IValidator <TransactionArgs> >()) .RunAsync(throwOnError: true).ConfigureAwait(false); return(Cleaner.Clean(await _dataService.GetTransactionsAsync(accountId, args, paging).ConfigureAwait(false))); }, BusinessInvokerArgs.Read).ConfigureAwait(false);
public Task <PostalInfo?> GetPostCodesAsync(RefDataNamespace.Country?country, string?state, string?city) => ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(country, state, city); await MultiValidator.Create() .Add(country.Validate(nameof(country)).Mandatory().IsValid()) .Add(state.Validate(nameof(state)).Mandatory()) .Add(city.Validate(nameof(city)).Mandatory()) .RunAsync(throwOnError: true).ConfigureAwait(false); return(Cleaner.Clean(await _dataService.GetPostCodesAsync(country, state, city).ConfigureAwait(false))); }, BusinessInvokerArgs.Read);
public Task DeleteAsync(Guid id) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Delete; Cleaner.CleanUp(id); MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Run().ThrowOnError(); await _dataService.DeleteAsync(id).ConfigureAwait(false); })); }
public Task <ProductCollectionResult> GetByArgsAsync(ProductArgs?args, PagingArgs?paging) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(args); MultiValidator.Create() .Add(args.Validate(nameof(args)).Entity(ProductArgsValidator.Default)) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.GetByArgsAsync(args, paging).ConfigureAwait(false)); })); }
public Task <Product?> GetAsync(int id) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(id); MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.GetAsync(id).ConfigureAwait(false)); })); }
public Task <Balance?> GetBalanceAsync(string?accountId) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(accountId); MultiValidator.Create() .Add(accountId.Validate(nameof(accountId)).Mandatory()) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.GetBalanceAsync(accountId).ConfigureAwait(false)); })); }
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);
public Task <TransactionCollectionResult> GetTransactionsAsync(string?accountId, TransactionArgs?args, PagingArgs?paging) { return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Read; Cleaner.CleanUp(accountId, args); MultiValidator.Create() .Add(accountId.Validate(nameof(accountId)).Mandatory().Common(Validators.AccountId)) .Add(args.Validate(nameof(args)).Entity(TransactionArgsValidator.Default)) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.GetTransactionsAsync(accountId, args, paging).ConfigureAwait(false)); })); }
public Task DeleteAsync(Guid id) => ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(id); await(_deleteOnPreValidateAsync?.Invoke(id) ?? Task.CompletedTask).ConfigureAwait(false); await MultiValidator.Create() .Add(id.Validate(nameof(id)).Mandatory()) .Additional((__mv) => _deleteOnValidate?.Invoke(__mv, id)) .RunAsync(throwOnError: true).ConfigureAwait(false); await(_deleteOnBeforeAsync?.Invoke(id) ?? Task.CompletedTask).ConfigureAwait(false); await _dataService.DeleteAsync(id).ConfigureAwait(false); await(_deleteOnAfterAsync?.Invoke(id) ?? Task.CompletedTask).ConfigureAwait(false); }, BusinessInvokerArgs.Delete);
public Task <PersonDetailCollectionResult> GetDetailByArgsAsync(PersonArgs?args, PagingArgs?paging) => ManagerInvoker.Current.InvokeAsync(this, async() => { Cleaner.CleanUp(args); await(_getDetailByArgsOnPreValidateAsync?.Invoke(args, paging) ?? Task.CompletedTask).ConfigureAwait(false); await MultiValidator.Create() .Add(args.Validate(nameof(args)).Entity().With <IValidator <PersonArgs> >()) .Additional((__mv) => _getDetailByArgsOnValidate?.Invoke(__mv, args, paging)) .RunAsync(throwOnError: true).ConfigureAwait(false); await(_getDetailByArgsOnBeforeAsync?.Invoke(args, paging) ?? Task.CompletedTask).ConfigureAwait(false); var __result = await _dataService.GetDetailByArgsAsync(args, paging).ConfigureAwait(false); await(_getDetailByArgsOnAfterAsync?.Invoke(__result, args, paging) ?? Task.CompletedTask).ConfigureAwait(false); return(Cleaner.Clean(__result)); }, BusinessInvokerArgs.Read);
public Task <Contact> CreateAsync(Contact value) { value.Validate(nameof(value)).Mandatory().Run().ThrowOnError(); return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Create; Cleaner.CleanUp(value); MultiValidator.Create() .Add(value.Validate(nameof(value))) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.CreateAsync(value).ConfigureAwait(false)); })); }
public Task <Contact> UpdateAsync(Contact value) { return(ManagerInvoker.Default.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; EntityBase.CleanUp(value); MultiValidator.Create() .Add(value.Validate(nameof(value)).Mandatory()) .Run().ThrowOnError(); var __result = await _dataService.UpdateAsync(value).ConfigureAwait(false); Cleaner.Clean(__result); return __result; })); }
public Task <Gender> UpdateAsync(Gender value, Guid id) { value.Validate(nameof(value)).Mandatory().Run().ThrowOnError(); return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; value.Id = id; Cleaner.CleanUp(value); MultiValidator.Create() .Add(value.Validate(nameof(value)).Entity(new ReferenceDataValidator <Gender>())) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.UpdateAsync(value).ConfigureAwait(false)); })); }
public Task <TripPerson> UpdateAsync(TripPerson value, string?id) { value.Validate(nameof(value)).Mandatory().Run().ThrowOnError(); return(ManagerInvoker.Current.InvokeAsync(this, async() => { ExecutionContext.Current.OperationType = OperationType.Update; value.Id = id; Cleaner.CleanUp(value); MultiValidator.Create() .Add(value.Validate(nameof(value))) .Run().ThrowOnError(); return Cleaner.Clean(await _dataService.UpdateAsync(value).ConfigureAwait(false)); })); }