davidwhitney / System.Configuration.Abstractions

Injectable, mockable, extensible, configuration for .NET
MIT License
42 stars 7 forks source link

Uri Converter #7

Closed oliversweb closed 9 years ago

oliversweb commented 9 years ago

Dave,

I find myself converting Uri entries in the config from strings to 'new Uri(string)' so hoping to perform this naturally within the 'System.Configuration.Abstractions.AppSetting()' method with a simple;

            if (typeof(T) == typeof(Uri))
                return (T) (object) (new Uri(rawSetting));

Rather than going down the path of supplying a list of Custom Converters, etc., what are you views?

Cheers,

Billy

davidwhitney commented 9 years ago

Yeah - makes sense - people will do that a lot and while it's not "primitive" it's a commonly used type. I might wire it as custom converters internally, but queue up this as one of the defaults - seem sensible?

oliversweb commented 9 years ago

Cool, I will prep a pr, ty

davidwhitney commented 9 years ago

:+1:

oliversweb commented 9 years ago

Pr created https://github.com/davidwhitney/System.Configuration.Abstractions/pull/8