Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
Created August 6, 2012 21:12
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 hmemcpy/3278477 to your computer and use it in GitHub Desktop.
Save hmemcpy/3278477 to your computer and use it in GitHub Desktop.
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
{
var db = container.Resolve<ISisoDatabase>();
container.Register<ISession>((c, overloads) => new SessionWrapper(db.BeginSession()));
}
public class SessionWrapper : ISession
{
readonly ISession session;
public SessionWrapper(ISession session)
{
this.session = session;
}
public void Dispose() <-- put a breakpoint here, never reached it
{
session.Dispose();
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment