public PersonFacade(ISessionFactoryHelper sessionFactoryHelper, IPersonRepository personRepository, ICommunicationRepository communicationRepository)
 {
     _sessionFactoryHelper = sessionFactoryHelper;
     _sessionFactory = _sessionFactoryHelper.CreateSessionFactory();
     _personRepository = personRepository;
     _communicationRepository = communicationRepository;
 }
Beispiel #2
0
 public PersonService(IPersonRepository pr, IPersonFactory pf, IUserRepository ur, IUserFactory uf)
 {
     this.PersonRepository = pr;
     this.PersonFactory = pf;
     this.UserRepository = ur;
     this.UserFactory = uf;
 }
Beispiel #3
0
        public PeopleModule(IPersonRepository personRepository)
            : base("/people")
        {
            this.personRepository = personRepository;

            Get["/"] = _ => AllPeople();
        }
 public AttendanceService(IAbsentReasonRepository absentRepository, IAttendanceRepository attendanceRepository, 
     IPersonRepository personRepository)
 {
     this.absentRepository = absentRepository;
     this.attendanceRepository = attendanceRepository;
     this.personRepository = personRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonRepositoryTests" /> class.
 /// </summary>
 public PersonRepositoryTests()
 {
     this.httpClientHelper = new Mock<IHttpClientHelper>();
     DataAccess.Dependencies.Register();
     DIContainer.Instance.RegisterInstance<IHttpClientHelper>(this.httpClientHelper.Object);
     this.personRepository = DIContainer.Instance.Resolve<IPersonRepository>();
 }
Beispiel #6
0
 public GvaNomController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IApplicationRepository applicationRepository,
     IPersonRepository personRepository,
     IAircraftRepository aircraftRepository,
     IAirportRepository airportRepository,
     IEquipmentRepository equipmentRepository,
     IOrganizationRepository organizationRepository,
     ICaseTypeRepository caseTypeRepository,
     INomRepository nomRepository,
     IStageRepository stageRepository,
     IExaminationSystemRepository examinationSystemRepository,
     IAircraftRegistrationRepository aircraftRegistrationRepository,
     IEnumerable<IDataGenerator> dataGenerators)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.applicationRepository = applicationRepository;
     this.personRepository = personRepository;
     this.aircraftRepository = aircraftRepository;
     this.airportRepository = airportRepository;
     this.equipmentRepository = equipmentRepository;
     this.organizationRepository = organizationRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.nomRepository = nomRepository;
     this.stageRepository = stageRepository;
     this.examinationSystemRepository = examinationSystemRepository;
     this.aircraftRegistrationRepository = aircraftRegistrationRepository;
     this.dataGenerators = dataGenerators;
 }
 public PersonController(IPersonRepository personRepository, IMapper mapper)
 {
     if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
     if (mapper == null) throw new ArgumentNullException(nameof(mapper));
     _personRepository = personRepository;
     _mapper = mapper;
 }
 public PersonService(
     IPersonRepository personRepository, 
     IPersonGroupRepository personGroupRepository, 
     IPermissionRepository permissionRepository, 
     IPersonRoleRepository personRoleRepository, 
     IPersonOptionalFieldRepository personOptionalFieldRepository, 
     IRelationshipRepository relationshipRepository,
     IChurchMatcherRepository churchMatcherRepository,
     IGroupRepository groupRepository,
     IFamilyRepository familyRepository,
     IEmailService emailService,
     IAddressRepository addressRepository,
     IPhotoRepository photoRepository)
 {
     _personRepository = personRepository;
     _personGroupRepository = personGroupRepository;
     _permissionRepository = permissionRepository;
     _personRoleRepository = personRoleRepository;
     _personOptionalFieldRepository = personOptionalFieldRepository;
     _relationshipRepository = relationshipRepository;
     _churchMatcherRepository = churchMatcherRepository;
     _groupRepository = groupRepository;
     _familyRepository = familyRepository;
     _emailService = emailService;
     _addressRepository = addressRepository;
     _photoRepository = photoRepository;
 }
Beispiel #9
0
 public PersonController()
 {
     //If default constructor is called, means it is "real" request
     //IDatabaseFactory factory = new MongoDBDatabaseFactory();
     IDatabaseFactory factory = new TestDatabaseFactory();
     databasePlaceholder = factory.GetPersonRepository();
 }
 public PersonListViewModel(IScreen hostScreen, IPersonRepository personRepository = null)
 {
     HostScreen = hostScreen;
     personRepository = personRepository ?? new PersonRepository();
     Persons = new ReactiveList<PersonItemViewModel>();
     NewPersonCommand = new ReactiveCommand(null);
     NewPersonCommand.RegisterAsyncAction(_ => { }).Subscribe(_ => HostScreen.Router.Navigate.Execute(new PersonAddViewModel(HostScreen)));
     RefreshCommand = new ReactiveCommand(null);
     var refresh = RefreshCommand.RegisterAsync<List<Person>>(_ => Observable.Start(() => personRepository.RetrievePersonsAsync().
                                                                                                           Result));
     refresh.Subscribe(list =>
     {
         using (Persons.SuppressChangeNotifications())
         {
             Persons.Clear();
             Persons.AddRange(personRepository.RetrievePersonsAsync().
                                               Result.Select(d => new PersonItemViewModel(d.FirstName,
                                                                      d.LastName,
                                                                      d.Age)));
         }
     });
     MessageBus.Current.Listen<Person>().
                Subscribe(p =>
                {
                    personRepository.AddPerson(p);
                    RefreshCommand.Execute(null);
                });
 }
Beispiel #11
0
 /// <summary>
 /// ATR: Constructor sobrecargado, permite parametrizar una instancia
 /// inyectada, sin una clase concreta. 
 /// </summary>
 /// <param name="injectedInstance"></param>
 public InjectorIoC(IPersonRepository injectedInstance)
 {
     if (!object.ReferenceEquals(injectedInstance, default(object)))
     {
         this.injectedInstance = injectedInstance;
     }
 }
        public PersonController()
        {
            var permissionRepository = new PermissionRepository();
            var churchRepository = new ChurchRepository();
            _personRepository = new PersonRepository(permissionRepository, churchRepository);
            var emailSender = new EmailSender(new MessageRepository(), new MessageRecepientRepository(), new MessageAttachmentRepository(), _personRepository);
            var churchEmailTemplateRepository = new ChurchEmailTemplatesRepository();
            var emailService = new EmailService(new UsernamePasswordRepository(permissionRepository), _personRepository, new GroupRepository(), emailSender, new EmailContentService(new EmailContentRepository()), churchEmailTemplateRepository, permissionRepository);
            var uploadPhotoRepository = new PhotoRepository();

            _personService = new PersonService(
                _personRepository,
                new PersonGroupRepository(_personRepository),
                permissionRepository,
                new PersonRoleRepository(),
                new PersonOptionalFieldRepository(),
                new RelationshipRepository(_personRepository),
                new ChurchMatcherRepository(),
                new GroupRepository(),
                new FamilyRepository(uploadPhotoRepository),
                emailService,
                new AddressRepository(),
                uploadPhotoRepository
                );
        }
        public void SetupPersonModelForTesting()
        {
            AutomapperConfiguration.Configure();
            _personRepository = Mock.Create<IPersonRepository>();

            _personModel = new PersonModel(_personRepository);
        }
 public PersonRepositoryIntegrationTest()
 {
     this.ctx = new WeNeedUHaveContext();
     this.unitOfWork = new UnitOfWork(ctx);
     this.adminRepository = new Repository<Admin>(unitOfWork);
     this.repository = new PersonRepository(unitOfWork, adminRepository);
 }
 public PersonController(IPersonRepository personRepository, IMappingEngine mappingEngine)
 {
     if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
     if (mappingEngine == null) throw new ArgumentNullException(nameof(mappingEngine));
     this._personRepository = personRepository;
     this._mappingEngine = mappingEngine;
 }
 public CompanyBusinessLogic(ICompanyRepository repository, IEmployeeRepository empRepository, IProjectRepository projectRepository, IPersonRepository personRepository)
 {
     _repository = repository;
     _empRepository = empRepository;
     _projectRepository = projectRepository;
     _personRepository = personRepository;
 }
 public PeopleController(IMappingEngine mappingEngine, IPersonRepository personRepository)
 {
     if (mappingEngine == null) throw new ArgumentNullException("mappingEngine");
     if (personRepository == null) throw new ArgumentNullException("personRepository");
     _mappingEngine = mappingEngine;
     _personRepository = personRepository;
 }
        public PersonDetailsViewModel(
            IEventAggregator eventAggregator,
            IPersonRepository repository,
            IApplicationCommands applicationCommands,
            IRegionManager regionManager)
        {
            this.regionManager = regionManager;
            this.eventAggregator = eventAggregator;
            this.repository = repository;
            this.SaveConfirmation = new InteractionRequest<IConfirmation>();
            ;

            eventAggregator.GetEvent<PersonSelectionEvent>()
                .Subscribe(this.OnPersonSelected, ThreadOption.PublisherThread);

            this.CreateNewCommand = new DelegateCommand(() => this.SelectedPerson = new Person());
            applicationCommands.NewCommand.RegisterCommand(this.CreateNewCommand);

            this.SaveCommand = new DelegateCommand(this.Save, this.CanSave);
            applicationCommands.SaveCommand.RegisterCommand(this.SaveCommand);

            this.GenerateNumbersCommand = new DelegateCommand(this.GenerateNumbers);

            this.ShowAnalyzationCommand = new DelegateCommand(this.ShowAnalyzation);
        }
 public UserService(IUserRepository userRepository, IPersonRepository personRepository, IPersonDetailMapper personDetailMapper, IManageUserMapper manageUserMapper)
 {
     _userRepository = userRepository;
     _personRepository = personRepository;
     _personDetailMapper = personDetailMapper;
     _manageUserMapper = manageUserMapper;
 }
Beispiel #20
0
 public PersonsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IApplicationRepository applicationRepository,
     IApplicationStageRepository applicationStageRepository,
     ICaseTypeRepository caseTypeRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     IPersonDocumentRepository personDocumentRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.applicationRepository = applicationRepository;
     this.applicationStageRepository = applicationStageRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.nomRepository = nomRepository;
     this.fileRepository = fileRepository;
     this.personDocumentRepository = personDocumentRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
 public PasswordService(IPersonRepository personRepository, IChurchRepository churchRepository, IUsernamePasswordRepository usernamePasswordRepository, IEmailService emailService)
 {
     _personRepository = personRepository;
     _churchRepository = churchRepository;
     _usernamePasswordRepository = usernamePasswordRepository;
     _emailService = emailService;
 }
Beispiel #22
0
 public ApplicationsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IOrganizationRepository organizationRepository,
     IAircraftRepository aircraftRepository,
     IAirportRepository airportRepository,
     IEquipmentRepository equipmentRepository,
     IDocRepository docRepository,
     IApplicationRepository applicationRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     IExaminationSystemRepository examinationSystemRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.organizationRepository = organizationRepository;
     this.aircraftRepository = aircraftRepository;
     this.airportRepository = airportRepository;
     this.equipmentRepository = equipmentRepository;
     this.docRepository = docRepository;
     this.applicationRepository = applicationRepository;
     this.nomRepository = nomRepository;
     this.examinationSystemRepository = examinationSystemRepository;
     this.fileRepository = fileRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
  public PersonListPageViewModel(IPersonRepository personRepository, INavigationService navService, IEventAggregator eventAggregator) {
      _personRepository = personRepository;
      _navService = navService;
      _eventAggregator = eventAggregator;
      NavCommand = new DelegateCommand<Person>(OnNavCommand);
      PersonDetailNavCommand = new DelegateCommand(() => _navService.Navigate("PersonDetail", 0));
 }
        public PersonController(IPersonRepository personRepository)
        {
            _personRepository = personRepository;
            _personHubContext = GlobalHost.ConnectionManager.GetHubContext<PersonHub>();
            _valueHubContext = GlobalHost.ConnectionManager.GetHubContext<ValueHub>();

            CreateTimer();
        }
 public UserRepository(ICredentialRepository credentialRepository,
                       IEmployeeRepository employeeRepository,
                       IPersonRepository personRepository)
 {
     _credentialRepository = credentialRepository;
     _employeeRepository = employeeRepository;
     _personRepository = personRepository;
 }
        public MembershipProviderManagementService(IPersonRepository personRepository,
                                                   ISecurityProvider securityProvider)
        {
            Check.Require(personRepository != null, "userRepository may not be null");

            _personRepository = personRepository;
            _securityProvider = securityProvider;
        }
        public ActivitiesController(IPersonRepository personRepository, ICustomerRepository customerRepository, 
            IActivityRepository activityRepository, IPrincipal authentication)
        {
			this.personRepository = personRepository;
			this.customerRepository = customerRepository;
			this.activityRepository = activityRepository;
            this.authentication = authentication;
        }
 public ReservationController(ITwilioMessageRepository repository, IMessageProvider<TwilioMessage> twilioMessageProvider,
                           IPersonRepository personRepository, ICodeGenerator codeGenerator)
 {
     _twilioRepository = repository;
       _personRepository = personRepository;
       _twilioMessageProvider = twilioMessageProvider;
       _codeGenerator = codeGenerator;
 }
Beispiel #29
0
 public PersonHandler(
     IEntityRepository<IEndowmentEntity> entityRepository,
     IPersonRepository personRepository,
     IPersonFactory personFactory)
 {
     _entityRepository = entityRepository;
     _personRepository = personRepository;
     _personFactory = personFactory;
 }
 public LendingController(ILendingRepository lendingRepository, IMappingEngine mappingEngine, IPersonRepository personRepository, IItemsRepository itemsRepository) : this(lendingRepository)
 {
     if (mappingEngine == null) throw new ArgumentNullException(nameof(mappingEngine));
     if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
     if (itemsRepository == null) throw new ArgumentNullException(nameof(itemsRepository));
     _mappingEngine = mappingEngine;
     _personRepository = personRepository;
     _itemsRepository = itemsRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetPersonQueryHandler" /> class.
 /// </summary>
 /// <param name="repo">Database repository.</param>
 /// <param name="query">Query instance.</param>
 public GetPersonQueryHandler(IPersonRepository repo, GetPersonQuery query)
 {
     _repo  = repo;
     _query = query;
 }
 private void ShowRepositoryType(IPersonRepository repository)
 {
     MessageBox.Show(string.Format("Repository Type:\n{0}",
                                   repository.GetType().ToString()));
 }
Beispiel #33
0
 /// <summary>
 /// Конструктор без параметров.
 /// </summary>
 public PersonService()
 {
     _personRepository = new PersonRepository();
 }
Beispiel #34
0
 public PersonService(IPersonRepository personRepository, IMapper mapper)
 {
     this.PersonRepository = personRepository;
     this.Mapper           = mapper;
 }
 public CommonMealStatisticOverviewMapper(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
Beispiel #36
0
 public MoviePersonStarService(IMapper mapper, IMovieRepository movieRepository, IPersonRepository personRepository, IMoviePersonStarRepository moviePersonStarRepository)
 {
     _mapper                    = mapper;
     _movieRepository           = movieRepository;
     _personRepository          = personRepository;
     _moviePersonStarRepository = moviePersonStarRepository;
 }
 public PersonApplication(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
 public BasePersonCommandHandler(IPersonRepository personRepository)
 {
     PersonRepository = personRepository;
 }
Beispiel #39
0
 public ServiceDataRepository([Injection(typeof(SqlDataRepository), 2018)] IPersonRepository repository)
 {
     Repository = repository;
 }
 public FamilyRepository(IPersonRepository personRepository, IMapper mapper, IImagesRepository imagesRepository)
 {
     _personRepository = personRepository;
     _mapper           = mapper;
     _imagesRepository = imagesRepository;
 }
 public PersonsController(IPersonRepository repo)
 {
     Repo = repo;
 }
 public PersonsController()
 {
     Repo = new PersonRepository();
 }
Beispiel #43
0
 public PersonService(IPersonRepository repository)
 {
     _repository = repository;
 }
 public PeopleController(IPersonRepository repository)
 {
     this.repository = repository;
 }
Beispiel #45
0
 public PersonAppService(IPersonRepository personRepositoryy)
 {
     _personRepository = personRepositoryy;
 }
Beispiel #46
0
 public PersonController(IPersonRepository personRepository,
                         PersonHandler personHandler)
 {
     _personRepository = personRepository;
     _personHandler    = personHandler;
 }
 public DeletePeronCommandHandler(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
Beispiel #48
0
 public PersonApplication(IPersonRepository personRepository, IMapper mapper, IAppLogger <PersonApplication> logger)
 {
     _personRepository = personRepository;
     _mapper           = mapper;
     _logger           = logger;
 }
 public PersonController(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
Beispiel #50
0
 public PersonBusiness(IPersonRepository repository)
 {
     _repository = repository;
     _converter  = new PersonConverter();
 }
 public PersonGreeterService(IPersonRepository personRepo, IUserContext user)
 {
     _personRepo = personRepo ?? throw new ArgumentNullException(nameof(personRepo));
     _user       = user ?? throw new ArgumentNullException(nameof(user));
 }
Beispiel #52
0
 public DownloadCardCommandExecutor(IPersonRepository personRepository,
                                    IPosterRepository posterRepository) : base(personRepository, posterRepository)
 {
 }
Beispiel #53
0
 public PersonUpdateHandler(IPersonRepository personRepository, IDistributedCache cache)
 {
     _personRepository = personRepository;
     this.cache        = cache;
 }
Beispiel #54
0
 public Person(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
Beispiel #55
0
 public AppController(MCronberg.IPersonRepository rep)
 {
     this.rep = rep;
 }
Beispiel #56
0
 public PersonController(IPersonRepository repository)
 {
     logger.Info("Создан контроллер для API");
     this.Repository = repository;
 }
Beispiel #57
0
 public PersonService(IPersonRepository personRepository)
 {
     _personRepository = personRepository;
 }
Beispiel #58
0
        static void Main(string[] args)
        {
            Triangle triangle   = new Triangle(5);
            int      numOfSides = triangle.NumberOfSides; // I have access to abstract properties (if public)

            // no access to private properties in abstract/base class
            triangle.MayOverwrite(); // I can still call abstract method even though not overwritten in child

            Octagon octagon = new Octagon(10);

            //IPersonRepository repo = new WebServiceRepository();
            //var people = repo.GetPeople();

            // I can use CSV repository instead easily
            // the code is exacly the same as above
            // without any changes
            //repo = new CSVRepository();
            //people = repo.GetPeople();

            //repo = new SQLRepository();
            //people = repo.GetPeople();

            // To refactor for (WebServiceRepo, CSV, SQLRepository) we will use Factory Method (RepositoryFactory class)
            // Compile time Factory -> application makes decision what repo to use
            // References to ALL repos have to be here (better to use Run-Time Binding (using reflection))
            // This allows us to NOT have references to all repos
            IPersonRepository repoFromFactory = RepositoryFactory.GetRepository("SQL");

            repoFromFactory.GetPeople();

            // TAKE TWO
            // Dynamic Loading
            // 1. Get Type and assembly from configuration
            // 2. Load assembly through reflection
            // 3. Create Repository instance with the Activator
            // This allows us to get repository without specifying Repo type
            IPersonRepository repoFromDynamicRepository = RepositoryFactoryDynamic.GetRepository();
            var people = repoFromDynamicRepository.GetPeople();

            // TAKE THREE -> UNIT TESTING
            // Need to add another layer (View Model) in order to take out dependencies
            // public ViewModel { private prop IPersonRepository and other properties
            // use ViewModel to bind all data to UI controls => then in UI page declare ViewModel
            // EX: viewModel = new ViewModel() => view model has all the data and access and fetching from DB
            // now we can do Unit Tests => just on ViewModel (responsible for all the work)


            // Layered approach
            // 1. Application => UI, click buttons etc
            // 2. ViewModel => does all the fetching from db/service/csv
            // 3. Repository => actual repos (CSV/SQL etc) => GetPerson, Update, Insert
            // 4. DataStorage => actual DB or CSV file

            // LAYERED APPROACH
            // 1. APPLICATION => Program/UI => has/init new ViewModel()
            // 2. VIEWMODEL => defines IPersonRepository() and has all CRUD Methods needed for UI
            // 3. REPOSITORY => using { } => Concrete type => gets the data from DB/CSV etc
            // 4. DATA_STORAGE => actual file or SQL DB

            // This would be in UI constructor class
            //MainViewModel viewModel;
            //viewModel = new MainViewModel();

            //viewModel.FetchDataForUi();

            // UNIT TESTING
            // Test if people box gets populated
            // Its easy now since we can use FakeRepository (consistant data), and test MainViewModel
            // to see if it gets populated correctly

            // TO GET FULLY QUALIFIED NAME
            //var fakeRepo = new FakeRepository();
            //string fullyQualifiedName = fakeRepo.GetType().AssemblyQualifiedName;
        }
 public PersonBusinessImplementation(IPersonRepository repository)
 {
     _repository = repository;
     _converter  = new PersonConverter();
 }
Beispiel #60
0
 public HomeController(IPersonRepository personRepository)
 {
     this.personRepository = personRepository;
 }