Example #1
0
 /// <summary>
 /// Returns the named IProfileProvider instance. Guaranteed to return an initialized IProfileProvider if no exception thrown.
 /// </summary>
 /// <param name="profileProviderName">Name defined in configuration for the Profile provider to instantiate</param>
 /// <returns>Named Profile provider instance</returns>
 /// <exception cref="ArgumentNullException">providerName is null</exception>
 /// <exception cref="ArgumentException">providerName is empty</exception>
 /// <exception cref="ConfigurationException">Could not find instance specified in providerName</exception>
 /// <exception cref="InvalidOperationException">Error processing configuration information defined in application configuration file.</exception>
 public static IProfileProvider GetProfileProvider(string profileProviderName)
 {
     ProfileProviderFactory factory = new ProfileProviderFactory(ConfigurationManager.GetCurrentContext());
     return factory.GetProfileProvider(profileProviderName);
 }
Example #2
0
        /// <summary>
        /// Returns the named IProfileProvider instance. Guaranteed to return an initialized IProfileProvider if no exception thrown.
        /// </summary>
        /// <param name="profileProviderName">Name defined in configuration for the Profile provider to instantiate</param>
        /// <returns>Named Profile provider instance</returns>
        /// <exception cref="ArgumentNullException">providerName is null</exception>
        /// <exception cref="ArgumentException">providerName is empty</exception>
        /// <exception cref="ConfigurationException">Could not find instance specified in providerName</exception>
        /// <exception cref="InvalidOperationException">Error processing configuration information defined in application configuration file.</exception>
        public static IProfileProvider GetProfileProvider(string profileProviderName)
        {
            ProfileProviderFactory factory = new ProfileProviderFactory(ConfigurationManager.GetCurrentContext());

            return(factory.GetProfileProvider(profileProviderName));
        }