I read this post by Phillip Haydon about how to use NHibernate/RavenDB with ServiceStack.
I don\'t see the point about getting the IDocumentStore and open new session every
The ways to introspect the Response in ServiceStack is with either:
Some other notes that might be helpful:
ServiceStack's built-in IOC (Funq) now supports RequestScope
You can add IDisposable
to a base class which gets called immediately after the service has finished executing, e.g. if you were to use an RDBMS:
public class FooServiceBase : IService, IDisposable
{
public IDbConnectionFactory DbFactory { get; set; }
private IDbConnection db;
public IDbConnection Db
{
get { return db ?? (db = DbFactory.OpenDbConnection()); }
}
public object Any(ProductFind request)
{
return new FooResponse {
Result = Db.Id(request.Id)
};
}
public void Dispose()
{
if (db != null) db.Dispose();
}
}