我有一个属性来标记名为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
}
可以看到,client&other的属性不包含dbvalue值。有没有可能:如果其他开发人员没有给出dbvalue,那么构造函数会给它分配相应的值?(对于客户端,dbvalue将为0;对于其他客户端,dbvalue将为2)。