public async Task <ExecutionResult> Execute(ExecuteContext <ICreateActiveDirectoryCompanyArguments> context) { try { var companyOu = await _activeDirectoryService.GenerateCompanyOuIdAsync(); await _activeDirectoryService.CreateCompany(new ActiveDirectoryCompany { CompanyOu = companyOu }); return(context.CompletedWithVariables(new CreateActiveDirectoryCompanyLog { CompanyOu = companyOu }, new { CompanyOu = companyOu })); } catch (System.Exception ex) { this.Log().Error("Error executing CreateActiveDirectoryComapnyActivity", ex); throw; } }