示例#1
0
 public ConstituentsController(ConstituentContext context, IConstituentRepository constituentRepository)
 {
     _repository            = new Repository <Constituent>(context);
     _contactRepo           = new Repository <ConstituentContact>(context);
     _context               = context;
     _constituentRepository = constituentRepository;
 }
示例#2
0
 public ConstituentAggregatesController(ConstituentContext context, IConstituentRepository constituentRepository, IEntityRepository entityRepository)
 {
     _repository            = new Repository <Constituent>(context);
     _entityRepo            = new Repository <Entity>(context);
     _contactRepo           = new Repository <ConstituentContact>(context);
     _context               = context;
     _constituentRepository = constituentRepository;
     _entityRepository      = entityRepository;
 }
 public RegistrationServiceImpl(IRegisterationRepository repository, IConstituentRepository constituentRepository, IMail mail, IEmailServiceImpl emailServiceImpl, IPhoneServiceImpl phoneServiceImpl, IAddressServiceImpl addressServiceImpl, ILoginServiceImpl loginServiceImpl)
 {
     this.constituentRepository = constituentRepository;
     this.repository = repository;
     this.emailServiceImpl = emailServiceImpl;
     this.phoneServiceImpl = phoneServiceImpl;
     this.addressServiceImpl = addressServiceImpl;
     this.loginServiceImpl = loginServiceImpl;
     this.mail = mail;
 }
 public ConstituentController(IConstituentRepository constituentRepository
     , IProductHasConstituentRepository productHasConstituentRepository
     , ILocatedInRepository locatedInRepository
     , IUnitOfWorkFactory unitOfWorkFactory
     , IRegionRepository regionRepository)
 {
     _constituentRepository = constituentRepository;
     _unitOfWorkFactory = unitOfWorkFactory;
     _locatedInRepository = locatedInRepository;
     _productHasConstituentRepository = productHasConstituentRepository;
     _regionRepository = regionRepository;
 }
        public ConstituentAggregatesControllerTests()
        {
            _options = new DbContextOptionsBuilder <ConstituentContext>()
                       .UseInMemoryDatabase(databaseName: "TestCRUD")
                       .Options;

            var context = new ConstituentContext(_options);

            _constituentRepo        = new ConstituentRepository(context);
            _genericConstituentRepo = new Repository <Constituent>(context);
            _genericContactRepo     = new Repository <ConstituentContact>(context);
            _entityRepo             = new EntityRepository(context);

            _controller = new ConstituentAggregatesController(context, _constituentRepo, _entityRepo);
            _controller.ControllerContext = new ControllerContext
            {
                HttpContext      = new DefaultHttpContext(),
                RouteData        = new RouteData(),
                ActionDescriptor = new ControllerActionDescriptor()
            };
        }