Beispiel #1
0
        public void Initialize(ICogsConfiguration configuration)
        {
            if(String.IsNullOrEmpty(configuration.ConnectionName))
                throw new ArgumentException("A Connection Name must be provided");

            var persister = new SqlPersister(configuration.ConnectionName);

            SessionFactory.GetSession =
                () => new CogsSession(persister, new JsonSerializer());
            Func<ICogsSessionManager> factoryMethod;
            ManagerConfigurations.TryGetValue(configuration.SessionManagementStrategy, out factoryMethod);
            SessionManagerFactory.GetSessionManager = factoryMethod ??
                                                      ManagerConfigurations[CogsSessionManagementStrategy.Static];
        }
 public Document GetDocument(string docStore, string docId)
 {
     var persister = new SqlPersister(docStore);
     var document = persister.Get(docId);
     return document;
 }
Beispiel #3
0
 private CogsSession GetCogsSession()
 {
     var persister = new SqlPersister("sqlce");
     var serializer = new JsonSerializer();
     return new CogsSession(persister, serializer);
 }