Created
August 27, 2012 20:41
-
-
Save bsommardahl/3492053 to your computer and use it in GitHub Desktop.
BlingInterceptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BlingInterceptor : EmptyInterceptor | |
{ | |
readonly IBlingInitializer _blingInitializer; | |
public BlingInterceptor(IBlingInitializer blingInitializer) | |
{ | |
_blingInitializer = blingInitializer; | |
} | |
public override bool OnLoad(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types) | |
{ | |
_blingInitializer.Initialize(entity); | |
return base.OnLoad(entity, id, state, propertyNames, types); | |
} | |
public override bool OnSave(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types) | |
{ | |
_blingInitializer.Initialize(entity); | |
return base.OnSave(entity, id, state, propertyNames, types); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment