Пример #1
0
        public async Task <ExecutionResult> Execute(ExecuteContext <ISoftDeleteDatabaseUserArguments> context)
        {
            var arguments = context.Arguments;

            await _office365DbUserService.SoftDeleteOffice365DatabaseUserAsync(arguments.UserPrincipalName);

            return(context.Completed(new SoftDeleteDatabaseUserLog
            {
                UserPrincipalName = arguments.UserPrincipalName
            }));
        }
        public async Task <CompensationResult> Compensate(CompensateContext <IActivateSoftDeletedDatabaseUserLog> context)
        {
            try
            {
                var logs = context.Log;

                await _office365DbUserService.SoftDeleteOffice365DatabaseUserAsync(logs.UserPrincipalName);
            }
            catch (Exception ex)
            {
                this.Log().Error("Componsate ActivateSoftDeletedDatabaseUserActivity failed!", ex);
            }

            return(context.Compensated());
        }