コード例 #1
0
ファイル: RavenRegistry.cs プロジェクト: northshoreab/Hygia
        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));
        }