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

            Cleaner.CleanUp(value, id);
            await value.Validate().Entity().With <IValidator <TerminationDetail> >().RunAsync(throwOnError: true).ConfigureAwait(false);
            return(Cleaner.Clean(await _dataService.TerminateAsync(value, id).ConfigureAwait(false)));
        }, BusinessInvokerArgs.Update).ConfigureAwait(false);
        public Task <Employee> TerminateAsync(TerminationDetail value, Guid id)
        {
            value.Validate(nameof(value)).Mandatory().Run().ThrowOnError();

            return(ManagerInvoker.Current.InvokeAsync(this, async() =>
            {
                ExecutionContext.Current.OperationType = OperationType.Update;
                Cleaner.CleanUp(value, id);
                value.Validate(nameof(value)).Entity(TerminationDetailValidator.Default).Run().ThrowOnError();
                return Cleaner.Clean(await _dataService.TerminateAsync(value, id).ConfigureAwait(false));
            }));
        }