Code:
Code:
public interface ICacheKeyProvider
{
string IdForCache { get; }
}
Code:
public class User: ICacheKeyProvider
{
public virtual Guid Id { get { return id; } }
public string IdForCache { get { return BuildIdForCache(Id); } }
public static string BuildIdForCache(Guid userId) { return userId.ToString(); }
}
Mapping:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="SomeNamespace.User, SomeNamespace" table="[User]">
<id name="Id" type="Guid" access="field.camelcase" column="id">
<generator class="guid" />
</id>
</class>
</hibernate-mapping>
Exception:
Code:
NHibernate.InvalidProxyTypeException: The following types may not be used as proxies:
SomeNamespace.User: method get_IdForCache should be virtual
But IdForCache isn't part of the mapping, so why should it be virtual?
And it worked as expected in 1.2.0.
Also, about new methods in IInterceptor.
Code:
public object Instantiate(string entityName, EntityMode entityMode, object id)
What should I do if I don't want to implement any custom instantiation process?
PS: where we can get documentation that reflects current codebase? Documentation wasn't the strongest side of the NHibernate for a long time now, but c'mon! no documentation at all? This is ridiculous!