Exemplo n.º 1
0
        public bool ConfigureStore()
        {
            if (!EsentConfig.DoesDatabaseExist(EsentConfig.DatabaseName))
            {
                EsentConfig.CreateDatabase();
            }

            return(true);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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));
        }