views:

49

answers:

1

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?

A: 

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>();
James Gregory
It is annoyingly simple now that I know the answer... Thanks!
Stefan Ahlm