Using T4 to generate a class wrapper for <appSettings />(tyronedavisjr.com)

submitted by tdavisjrtdavisjr(335) 2 years, 5 months ago

Last week I wanted to generate a object wrapper around the <appSettings> section in my web.config/app.config file and after doing the same thing over and over again by generating a public read-only property for each setting, I decided to use T4 to read the <appSettings> section and generate a class all the properties that would become the wrapper around the ConfigurationManager.AppSettings[“…”] calls to retrieve the settings. To my surprise, this was pretty easy to do.

1 comment |category: |Views: 151

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by DanAtkinsonDanAtkinson(0) 2 years, 3 months ago 0

I don't believe this! I just wrote this same thing in C# and T4 and was going to publish a blog post about it when I thought I'd Google it!

Reply

information Login or create an account to comment on this story