public async Task <ExecutionResult> Execute(ExecuteContext <IActivateSoftDeletedDatabaseUserArguments> context) { var arguments = context.Arguments; var office365User = await _office365DbUserService.ActivateOffice365DatabaseUserAsync(arguments.UserPrincipalName); return(context.CompletedWithVariables(new ActivateSoftDeletedDatabaseUserLog { UserPrincipalName = arguments.UserPrincipalName }, new { office365User.Licenses.FirstOrDefault()?.Office365Offer.CloudPlusProductIdentifier })); }
public async Task <CompensationResult> Compensate(CompensateContext <ISoftDeleteDatabaseUserLog> context) { try { var logs = context.Log; await _office365DbUserService.ActivateOffice365DatabaseUserAsync(logs.UserPrincipalName); } catch (Exception ex) { this.Log().Error("Compensate SoftDeleteDatabaseUserActivity failed!", ex); } return(context.Compensated()); }