I am trying to use the .NET configuration and understand user sections, elements, etc.
It seems that implementing these custom sections requires explicit declaration of getters and setters, which generally leads to bloat code.
For instance:
http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
In particular, it seems to us necessary to explicitly return and set things in the get and set methods.
[ConfigurationProperty("remoteOnly", DefaultValue = "false", IsRequired = false)]
public Boolean RemoteOnly
{
get
{
return (Boolean)this["remoteOnly"];
}
set
{
this["remoteOnly"] = value;
}
}
With the following
[ConfigurationProperty("remoteOnly", DefaultValue = "false", IsRequired = false)]
public Boolean RemoteOnly { get; set }
not equivalent to the above.
Is this true: do we need to be verbose even with such vanilla properties?
source
share