Пример #1
0
        public async Task <Gender> CreateAsync(Gender value) => await ManagerInvoker.Current.InvokeAsync(this, async() =>
        {
            await value.Validate().Mandatory().RunAsync(throwOnError: true).ConfigureAwait(false);

            Cleaner.CleanUp(value);
            return(Cleaner.Clean(await _dataService.CreateAsync(value).ConfigureAwait(false)));
        }, BusinessInvokerArgs.Create).ConfigureAwait(false);
Пример #2
0
        public Task <Gender> CreateAsync(Gender value)
        {
            value.Validate(nameof(value)).Mandatory().Run().ThrowOnError();

            return(ManagerInvoker.Current.InvokeAsync(this, async() =>
            {
                ExecutionContext.Current.OperationType = OperationType.Create;
                Cleaner.CleanUp(value);
                return Cleaner.Clean(await _dataService.CreateAsync(value).ConfigureAwait(false));
            }));
        }