Example #1
0
        public async Task <Robot> UpdateAsync(Robot value, Guid id) => await ManagerInvoker.Current.InvokeAsync(this, async() =>
        {
            await value.Validate().Mandatory().RunAsync(throwOnError: true).ConfigureAwait(false);

            value.Id = id;
            Cleaner.CleanUp(value);
            await value.Validate().Entity().With <IValidator <Robot> >().RunAsync(throwOnError: true).ConfigureAwait(false);
            return(Cleaner.Clean(await _dataService.UpdateAsync(value).ConfigureAwait(false)));
        }, BusinessInvokerArgs.Update).ConfigureAwait(false);
Example #2
0
        public Task <Robot> UpdateAsync(Robot 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);
                value.Validate(nameof(value)).Entity(RobotValidator.Default).Run().ThrowOnError();
                return Cleaner.Clean(await _dataService.UpdateAsync(value).ConfigureAwait(false));
            }));
        }