ChrisMissal / Formo

Formo allows you to use your configuration file as a dynamic object. Turn your web.config or application settings into a rich, dynamic object.
http://chrismissal.com/Formo/
MIT License
259 stars 33 forks source link

Support for connection string #18

Closed henninga closed 10 years ago

henninga commented 11 years ago

Perhaps add support for connection strings, and/or other parts of the configuration file.

Possible api might be:

config.ConnectionString.SomeConnectionStringName
ChrisMissal commented 11 years ago

I've been waiting for somebody to suggest this :smiley:

gmasselli commented 11 years ago

Why not support the dynamic creation of the connection object using the binding feature and type converters as necessary?

Configuration().Connections.MyConnectionName.Instance()

You could still expose the actual properties to refrain from creating an object until desired by the consumer.

On Mar 6, 2013, at 8:42 AM, Chris Missal notifications@github.com wrote:

I've been waiting for somebody to suggest this

— Reply to this email directly or view it on GitHub.

ChrisMissal commented 11 years ago

@gmasselli Right now, Formo is leaving those kinds of optimizations up to the consumer. I think I prefer @henninga's example a bit more simply because it has fewer dots :-\

gmasselli commented 11 years ago

One dot can make all the difference! ;)

ChrisMissal commented 10 years ago

This has been added, the API matches @henninga's suggestion.