I'm using the automapping feature of FluentNHibernate and need a property that derives its return value. This property must return an Enum value, e.g.
public virtual MyEnum MyDerivedProperty
{
get
{
MyEnum retval;
// do some calculations
return retval;
}
}
Currently I get the following exception:
NHibernate.PropertyNotFoundException: Could not find a setter for property 'MyDerivedProperty' ...
If I add a setter then the database table involved requires the column to exist, even if that setter does nothing.
It works fine when the return type is an int.
Any ideas how I achieve this?