Fluent NHibernate beginner problem: How to convert single column data to custom class?
I am very new to Fluent NHibernate and I have a problem that I cant find the answer to.
I have a string column in my database table, containing a mathematical expression i.e: "10 + 15 * 5". On my entity I have a property that I call Formula and this returns a class that contains the mathematical "formula" (not as a string)开发者_如何学编程.
I beleive this post http://intellect.dk/post/Implementing-custom-types-in-nHibernate.aspx explains how to solve it for NHibernate. But I am not sure...
How do I get this working with Fluent NHibernate?
Once you've created your user type (which is what your link is about), you then just need to specify it on the property.
Map(x => x.YourProperty)
.CustomType<YourUserType>();
精彩评论