Skip to content

Instantly share code, notes, and snippets.

@GregOnNet
Last active December 17, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GregOnNet/5570591 to your computer and use it in GitHub Desktop.
Save GregOnNet/5570591 to your computer and use it in GitHub Desktop.
public class SeeThatRepository
{
private ISession _session;
public SeeThatRepository(ISession session)
{
_session = session;
}
public void Save(T entity)
{
using (var t = _session.BeginTransaction())
{
_session.Save(entity);
t.Commit();
}
}
public void Update(T entity)
{
using (var t = _session.BeginTransaction())
{
_session.Update(entity);
t.Commit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment