public async Task CreateAllListsAsync(string siteRootId, string requestId = "") { _logger.LogInformation($"RequestId: {requestId} - SetupService_CreateAllListsAsync called."); var sharepointLists = GetSharePointLists(); var siteList = new SiteList(); siteList.SiteId = siteRootId; foreach (var list in sharepointLists) { try { string htmlBody = string.Empty; switch (list) { case ListSchema.OpportunitiesListId: htmlBody = SharePointListsSchemaHelper.OpportunitiesJsonSchema(_appOptions.OpportunitiesListId); break; case ListSchema.Permissions: htmlBody = SharePointListsSchemaHelper.PermissionJsonSchema(_appOptions.Permissions); break; case ListSchema.ProcessListId: htmlBody = SharePointListsSchemaHelper.WorkFlowItemsJsonSchema(_appOptions.ProcessListId); break; case ListSchema.OpportunityMetaDataId: htmlBody = SharePointListsSchemaHelper.OpportunityMetaDataJsonSchema(_appOptions.OpportunityMetaDataId); break; case ListSchema.RoleListId: htmlBody = SharePointListsSchemaHelper.RoleJsonSchema(_appOptions.RoleListId); break; case ListSchema.GroupsListId: htmlBody = SharePointListsSchemaHelper.GroupJsonSchema(_appOptions.GroupsListId); break; case ListSchema.TemplateListId: htmlBody = SharePointListsSchemaHelper.TemplatesJsonSchema(_appOptions.TemplateListId); break; case ListSchema.DashboardListId: htmlBody = SharePointListsSchemaHelper.DashboardJsonSchema(_appOptions.DashboardListId); break; case ListSchema.TasksListId: htmlBody = SharePointListsSchemaHelper.TasksJsonSchema(_appOptions.TasksListId); break; } await _graphSharePointAppService.CreateSiteListAsync(htmlBody, siteRootId); } catch (Exception ex) { _logger.LogError($"RequestId: {requestId} - SetupService_CreateAllListsAsync error: {ex}"); } } }
public async Task CreateAllListsAsync(string siteRootId, string requestId = "") { _logger.LogInformation($"RequestId: {requestId} - SetupService_CreateAllListsAsync called."); var sharepointLists = GetSharePointLists(); var siteList = new SiteList(); siteList.SiteId = _appOptions.ProposalManagementRootSiteId; if (string.IsNullOrEmpty(siteList.SiteId)) { siteList.SiteId = siteRootId; } foreach (var list in sharepointLists) { try { string htmlBody = string.Empty; switch (list) { case ListSchema.CategoriesListId: htmlBody = SharePointListsSchemaHelper.CategoriesJsonSchema(_appOptions.CategoriesListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.IndustryListId: htmlBody = SharePointListsSchemaHelper.IndustryJsonSchema(_appOptions.IndustryListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.OpportunitiesListId: htmlBody = SharePointListsSchemaHelper.OpportunitiesJsonSchema(_appOptions.OpportunitiesListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.Permissions: htmlBody = SharePointListsSchemaHelper.PermissionJsonSchema(_appOptions.Permissions); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.ProcessListId: htmlBody = SharePointListsSchemaHelper.WorkFlowItemsJsonSchema(_appOptions.ProcessListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.RegionsListId: htmlBody = SharePointListsSchemaHelper.RegionsJsonSchema(_appOptions.RegionsListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.RoleListId: htmlBody = SharePointListsSchemaHelper.RoleJsonSchema(_appOptions.RoleListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.RoleMappingsListId: htmlBody = SharePointListsSchemaHelper.RoleMappingsJsonSchema(_appOptions.RoleMappingsListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.TemplateListId: htmlBody = SharePointListsSchemaHelper.TemplatesJsonSchema(_appOptions.TemplateListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.DashboardListId: htmlBody = SharePointListsSchemaHelper.DashboardJsonSchema(_appOptions.DashboardListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; case ListSchema.TasksListId: htmlBody = SharePointListsSchemaHelper.TasksJsonSchema(_appOptions.TasksListId); await _graphSharePointAppService.CreateSiteListAsync(htmlBody); break; } } catch (Exception ex) { _logger.LogError($"RequestId: {requestId} - SetupService_CreateAllListsAsync error: {ex}"); } } }