private readonly ITeacherDeclarationRepository _teaDeclRepo; // = ServiceLocator.Current.GetInstance<ITeacherDeclarationRepository>();

        #endregion Fields

        #region Constructors

        public SubscriptionAppl(ITypeAdapter adapter,
            IStudentDeclarationJiaoWuRepository stuDeclJiaoWuRepo,
            ITeacherDeclarationJiaoWuRepository teaDeclJiaoWuRepo,
            IStudentDeclarationRepository stuDeclRepo,
            ITeacherDeclarationRepository teaDeclRepo,
            ISubscriptionRepository subscriptionRepo,
            IRepositoryContext context
            )
        {
            _adapter = adapter;
            _stuDeclRepo = stuDeclRepo;
            _teaDeclRepo = teaDeclRepo;
            _stuDeclJiaoWuRepo = stuDeclJiaoWuRepo;
            _teaDeclJiaoWuRepo = teaDeclJiaoWuRepo;
            _subscriptionRepo = subscriptionRepo;
            _contextForUpdate = context;
        }
 public SubscriptionAppl(ITypeAdapter adapter,
                         IStudentDeclarationJiaoWuRepository stuDeclJiaoWuRepo,
                         ITeacherDeclarationJiaoWuRepository teaDeclJiaoWuRepo,
                         IStudentDeclarationRepository stuDeclRepo,
                         ITeacherDeclarationRepository teaDeclRepo,
                         ISubscriptionRepository subscriptionRepo,
                         IRepositoryContext context
                         )
 {
     _adapter           = adapter;
     _stuDeclRepo       = stuDeclRepo;
     _teaDeclRepo       = teaDeclRepo;
     _stuDeclJiaoWuRepo = stuDeclJiaoWuRepo;
     _teaDeclJiaoWuRepo = teaDeclJiaoWuRepo;
     _subscriptionRepo  = subscriptionRepo;
     _contextForUpdate  = context;
 }
        public void Initialize()
        {
            _context = new EntityFrameworkRepositoryContext();
            _trans   = new TransactionScope();

            _adapter           = new AutoMapperTypeAdapter();
            _stuDeclJiaoWuRepo = new StudentDeclarationJiaoWuRepository(_context);
            _teaDeclJiaoWuRepo = new TeacherDeclarationJiaoWuRepository(_context);
            _stuDeclRepo       = new StudentDeclarationRepository(_context);
            _teaDeclRepo       = new TeacherDeclarationRepository(_context);
            _subscriptionRepo  = new SubscriptionRepository(_context);

            _appl = new SubscriptionAppl(
                _adapter,
                _stuDeclJiaoWuRepo,
                _teaDeclJiaoWuRepo,
                _stuDeclRepo,
                _teaDeclRepo,
                _subscriptionRepo
                );
        }
        public void Initialize()
        {
            _context = new EntityFrameworkRepositoryContext();
            _trans = new TransactionScope();

            _adapter = new AutoMapperTypeAdapter();
            _stuDeclJiaoWuRepo = new StudentDeclarationJiaoWuRepository(_context);
            _teaDeclJiaoWuRepo = new TeacherDeclarationJiaoWuRepository(_context);
            _stuDeclRepo = new StudentDeclarationRepository(_context);
            _teaDeclRepo = new TeacherDeclarationRepository(_context);
            _subscriptionRepo = new SubscriptionRepository(_context);

            _appl = new SubscriptionAppl(
                _adapter,
                _stuDeclJiaoWuRepo,
                _teaDeclJiaoWuRepo,
                _stuDeclRepo,
                _teaDeclRepo,
                _subscriptionRepo
                );
        }
 public DeclarationQueryAppl(ITypeAdapter adapter, IStudentDeclarationJiaoWuRepository studentRepo, ITeacherDeclarationJiaoWuRepository teacherRepo)
 {
     _adapter = adapter;
     _studentRepo = studentRepo;
     _teacherRepo = teacherRepo;
 }
 public DeclarationQueryAppl(ITypeAdapter adapter, IStudentDeclarationJiaoWuRepository studentRepo, ITeacherDeclarationJiaoWuRepository teacherRepo)
 {
     _adapter     = adapter;
     _studentRepo = studentRepo;
     _teacherRepo = teacherRepo;
 }