I have an attribute to mark enum fields named BusinessDescription.
public enum FailReason
{
[BusinessDescription(Description="the client cancelled the order")]
Client = 0,
[BusinessDescription(Description="vender cancelled", DBValue = 1)]
Vender = 1,
[BusinessDescription(Description="other")]
Other = 2
}
You see, the attributes of Client & Other don't contain DBValue values. Is it possible that: if other developers didn't give a DBValue, the constructor will assign corresponding value to it? (for Client, DBValue will be 0; for Other, DBValue will be 2).