Skip to content

Instantly share code, notes, and snippets.

@pdoran
Last active August 29, 2015 14:03
Show Gist options
  • Save pdoran/161000713126d28be4c6 to your computer and use it in GitHub Desktop.
Save pdoran/161000713126d28be4c6 to your computer and use it in GitHub Desktop.
Generic Class
public class NHInterceptor : EmptyInterceptor
{
public void OnSave(object entity,
object id,
object[] state,
string[] propertyNames,
IType[] types)
{
var genericObj = new Message<?>(entity);
//What goes in the question mark's place?
}
}
public class Message<TEntity> {
T Payload { get; private set; }
public Message(T data) {
Payload = data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment