I have an NHibernate object that looks like this:
public class Offender
{
public virtual string FName { get; set; }
public virtual string MName { get; set; }
public virtual string LName { get; set; }
public string FullName
{
get
{
return FName + " " + MName + " " + LName;
}
}
}
The full name is a convenience property and is not in the database. But NHibernate does not like the property to be there and throw this exception:
The following types may not be used as proxies:
mPSOR.Data.Entities.SORPerson: method get_FullName should be 'public/protected virtual' or 'protected internal virtual'
Is there a way to enable an auxiliary property? Or do I need to calculate the calculations like this when compiling the DTO, or in my opinion?
source
share