Suppose I have a class Customer that is mapped to the database and everything is a-ok.
Now suppose that I want to retrieve – in my application – the column name that NH knows Customer.FirstName maps to.
How would I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can access the database field name through
NHibernate.Cfg.Configuration:The
ColumnIteratorproperty returnsIEnumerable<NHibernate.Mapping.ISelectable>. In almost all cases properties are mapped to a single column so the column name can be found usingproperty.ColumnInterator.ElementAt(0).Text.