示例#1
0
        static IDocumentSession OpenSession(IContext ctx)
        {
            var request = ctx.GetInstance <IFubuRequest>();


            string environmentId = request.Get <ContextInputModel>().EnvironmentId;


            var currentStore = ctx.GetInstance <IDocumentStore>();


            return(RavenSession.OpenSession(environmentId, currentStore));
        }
示例#2
0
        static IDocumentSession OpenSession(IContext ctx)
        {
            var    bus           = ctx.GetInstance <IBus>();
            string environmentId = null;

            if (bus.CurrentMessageContext != null && bus.CurrentMessageContext.Headers.ContainsKey("EnvironmentId"))
            {
                environmentId = bus.CurrentMessageContext.Headers["EnvironmentId"];
            }

            var store = ctx.GetInstance <IDocumentStore>();

            return(RavenSession.OpenSession(environmentId, store));
        }