Dofactory.com
Dofactory.com
 Back to list
Views:   9K
Replies:  1
Archived

How to write a Custom Configuration Collection Section with Composite Pattern


 I want to write Composite Pattern to web.config like below

 <membership defaultProvider="TestSqlMembershipProvider">
      <providers>
           <add name="TestSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider"      
                    connectionStringName="TestConsumerEndPoint" enablePasswordRetrieval="false" enablePasswordReset="true"
                     requiresQuestionAndAnswer="false" applicationName="Nda" requiresUniqueEmail="true" passwordFormat="Hashed"
                     maxInvalidPasswordAttempts="10" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
                      passwordAttemptWindow="3"/>                
      </providers>
 </membership>

Also I want to create this object using the Abstract Factory pattern.
Any idea how to go about this?

Thanks.
Volkan Genç, Aug 28, 2012
Reply 1
Volkan,

I'm not sure what you are asking, but I have built an open source application called MvcInstaller that programmatically creates the Membership sections in the web.config.  You can see a video of the application that uses this here, http://www.mvccentral.net/s/45.

You can also get the code at my github.com repository here: https://github.com/kahanu/MvcInstaller.

Here's a quick look at the code: https://github.com/kahanu/MvcInstaller/blob/master/MvcInstallerV3/ConfigurationFactory.cs

I hope this helps.

King Wilder
King Wilder, Sep 05, 2012
Hmm, don't know. As stated I just downloaded the SQL Server Express yesterday, after installing the DoFactory software. I got it from here: http://www.microsoft.com/sqlserver/en/us/editions/express.aspx I am using Windows 7, 64-bit edition. Could it be that I need to install &quot;SQL Express&quot; and not &quot;SQL Server Express&quot; as stated in your Getting Started document? I don't really see such a product on the microsoft web-site though.
Aug 04, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.