/// <summary> /// Gets the a <see cref="ConfigurationSectionInfo"/> for the database settings configuration section. /// </summary> /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param> /// <returns>A <see cref="ConfigurationSectionInfo"/> for the database settings configuration section.</returns> protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider) { ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); DatabaseSectionNode node = null; if (null != rootNode) node = rootNode.Hierarchy.FindNodeByType(rootNode, typeof(DatabaseSectionNode)) as DatabaseSectionNode; DatabaseSettings databaseSection = null; if (node == null) { databaseSection = null; } else { DatabaseSectionBuilder builder = new DatabaseSectionBuilder(serviceProvider, node); databaseSection = builder.Build(); } return new ConfigurationSectionInfo(node, databaseSection, DatabaseSettings.SectionName); }
/// <summary> /// Gets the a <see cref="ConfigurationSectionInfo"/> for the database settings configuration section. /// </summary> /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param> /// <returns>A <see cref="ConfigurationSectionInfo"/> for the database settings configuration section.</returns> protected override ConfigurationSectionInfo GetConfigurationSectionInfo(IServiceProvider serviceProvider) { ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); DatabaseSectionNode node = null; if (null != rootNode) { node = rootNode.Hierarchy.FindNodeByType(rootNode, typeof(DatabaseSectionNode)) as DatabaseSectionNode; } DatabaseSettings databaseSection = null; if (node == null) { databaseSection = null; } else { DatabaseSectionBuilder builder = new DatabaseSectionBuilder(serviceProvider, node); databaseSection = builder.Build(); } return(new ConfigurationSectionInfo(node, databaseSection, DatabaseSettings.SectionName)); }