Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created August 25, 2010 13:19
Show Gist options
  • Save kkozmic/549484 to your computer and use it in GitHub Desktop.
Save kkozmic/549484 to your computer and use it in GitHub Desktop.
public sealed class NHibernateProxyGenerationHook:IProxyGenerationHook
{
public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo)
{
// unless for some reason you don't want to intercept everything you can
return true;
}
public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo)
{
// you can catch non-interceptable members here
}
public void MethodsInspected()
{
}
public override bool Equals(object obj)
{
return (obj as NHibernateProxyGenerationHook) != null;
}
public override int GetHashCode()
{
return GetType().GetHashCode();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment