1

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 DoorLength { 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 !

1 Answer 1

2

You could initialize the private field to a default value.

private string sDoorLength = "Test";
Sign up to request clarification or add additional context in comments.

1 Comment

Haha! No problem, happens to me all the time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.