Hi,
I don't think NHibernate can somehow automatically cast the return value to an interface for you. You could maybe do something clever with reflection to do that yourself though.
Is the reason for the interface to prevent clients using the public mutators? If so, another possibility is to simply mark them as protected (NHibernate proxies can still access them):
Code:
public String Name
{
get { return this._name; }
protected set { this._name = value; }
}
NHibernate can also access the fields directly when setting, allowing your class to have a read-only public property.
Regards,
Richard