开发者

Nhibernate .Net attribute mapping. It is possible to set default value?

It is possible to set a default value for attribute mapping ? Example, if i have this property :

private string sDoorLength;
[NHibernate.Mapping.Attributes.Property(Column = "door_length")]
public string DoorLeng开发者_JS百科th { get { return sDoorLength; } set { sDoorLength = value; } }

I want to know if it's possible to add a parameter to NHibernate.Mapping.Attributes.Property for setting a default value. Like [NHibernate.Mapping.Attributes.Property(Column = "door_length", Default="Test")] or something like that.

Thank you !


You could initialize the private field to a default value.

private string sDoorLength = "Test";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜