Beispiel #1
0
        public bool ConfigureStore(string storeName, StoreTransactionOption storeTransactionOption)
        {
            if (!EsentConfig.DoesDatabaseExist("PhantomPubsub.edb"))
            {
                EsentConfig.CreateDatabaseAndActorStore(storeName);
            }
            else
            {
                if (!EsentConfig.DoesStoreExist(storeName))
                {
                    EsentConfig.CreateMessageStore(storeName, null);
                }
            }

            return(true);
        }
Beispiel #2
0
        public Connection GetConnection <T>()
        {
            var  storeName = CleanupName(typeof(T).ToString());
            bool exists    = false;

            if (!this.tableDoesExist.TryGetValue(storeName, out exists))
            {
                if (!EsentConfig.DoesStoreExist(storeName, this.EsentInstance))
                {
                    EsentConfig.CreateMessageStore(storeName, this.EsentInstance);
                    this.tableDoesExist.Add(storeName, true);
                }
            }

            var connection = new Connection(context);

            return(GetConnection <T>(connection));
        }