Beispiel #1
0
        public EsaRepository(
            ISessionFactory sessionFactory,
            IEsaFactory esaFactory)
        {
            if (sessionFactory == null)
            {
                throw new ArgumentNullException("sessionFactory");
            }
            if (esaFactory == null)
            {
                throw new ArgumentNullException("esaFactory");
            }

            this.sessionFactory = sessionFactory;
            this.esaFactory     = esaFactory;
        }
Beispiel #2
0
        internal ApproachService(
            Func <ISessionFactory, IApproachRepository> approachRepositoryFactory,
            Func <ISessionFactory, IEsaRepository> esaRepositoryFactory,
            ISessionFactoryProvider sessionFactoryProvider,
            IDeviationObserver deviationObserver,
            IDeviationFactory deviationFactory,
            IEsaDtoBuilder builder,
            IEsaFactory factory)
        {
            if (approachRepositoryFactory == null)
            {
                throw new ArgumentNullException("approachRepositoryFactory");
            }
            if (esaRepositoryFactory == null)
            {
                throw new ArgumentNullException("esaRepositoryFactory");
            }
            if (sessionFactoryProvider == null)
            {
                throw new ArgumentNullException("sessionFactoryProvider");
            }
            if (deviationObserver == null)
            {
                throw new ArgumentNullException("deviationObserver");
            }
            if (deviationFactory == null)
            {
                throw new ArgumentNullException("deviationFactory");
            }
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            ISessionFactory sessionFactory = sessionFactoryProvider.ForWorkspace();

            this.approachRepository = approachRepositoryFactory.Invoke(sessionFactory);
            this.esaRepository      = esaRepositoryFactory.Invoke(sessionFactory);
            this.deviationFactory   = deviationFactory;
            this.deviationObserver  = deviationObserver;
            this.builder            = builder;
            this.factory            = factory;
        }