Skip to content

Instantly share code, notes, and snippets.

@mikeobrien
Created January 18, 2013 01:40
Show Gist options
  • Save mikeobrien/4561587 to your computer and use it in GitHub Desktop.
Save mikeobrien/4561587 to your computer and use it in GitHub Desktop.
public static IRepository<T> GetRepository<T>(ISession session, string table) where T : class, new()
{
return GetRepositoryFactory<T>(session).CreateFor<T>(table);
}
public static IRepository<T> GetRepositoryFactory<T>(ISession session) where T : class, new()
{
return new RepositoryFactory(new Gribble.NHibernate.ConnectionManager(session), Mappings(typeof(T).Assembly));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment