Пример #1
0
 public void foo()
 {
     var config = new NHibernateSessionConfig("Chatsworth.Core", "Data Source=chatsworthdb.s3db;Version=3");
     var manager = new NHibernateSessionManager(config);
     var chatsRepos = new ChatMemberRespository(manager);
     var foo = chatsRepos.GetAll();
     Assert.IsNotNull(foo);
 }
        private void ConfigureServices(ILog log)
        {
            NHibernateSessionManager sessionManager = CreateSessionManager();
            var chatMemberRespository = new ChatMemberRespository(sessionManager);
            var linkLoggerRepository = new LinkLoggerRepository(sessionManager);

            var directory = ServiceLocator.Retrieve<IMemberDirectory>();
            directory.Log = log;
            directory.AttachRepository(chatMemberRespository);

            var linkLogger = ServiceLocator.Retrieve<ILinkLogger>();
            linkLogger.Log = log;
            linkLogger.AttachRepository(linkLoggerRepository);
        }
Пример #3
0
 public void AttachRepository(ChatMemberRespository respository)
 {
     _repository = respository;
     _subscribers = _repository.GetChatMembers().ToList();
 }