liubiao4123 / servicestack

Automatically exported from code.google.com/p/servicestack
0 stars 0 forks source link

ConfigurationResourceManager.Get does not return defaultValue #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When doing the following:

new ServiceStack.Configuration.ConfigurationResourceManager().Get("Foo", "Bar")

One would expect the result to be "Bar" if the setting is not present, but it 
becomes null.

I've downloaded the latest ServiceStack, and the reflected code looks like this:

public T Get<T>(string name, T defaultValue)
{
    return TypeSerializer.DeserializeFromString<T>(ConfigUtils.GetNullableAppSetting(name));
}

defaultValue is never used.

Original issue reported on code.google.com by GrimaceO...@gmail.com on 24 Aug 2010 at 8:51

GoogleCodeExporter commented 8 years ago
Yep definitely an oversight. I've added a fix which will be available from the 
next release. I've attached the updated .dlls to this comment as it sometimes 
takes google a while to propagate release downloads. 

Let me know if this fixes it.

 - Demis

Original comment by demis.be...@gmail.com on 24 Aug 2010 at 9:06

Attachments:

GoogleCodeExporter commented 8 years ago
Response times like that should be made illegal :D

Your fix works like charm. Thanks!

Original comment by GrimaceO...@gmail.com on 24 Aug 2010 at 9:25

GoogleCodeExporter commented 8 years ago
lol :-)

Original comment by demis.be...@gmail.com on 24 Aug 2010 at 9:28