Пример #1
0
        /// <summary>
        /// This allows all of the renters to be retrieved
        /// </summary>
        /// <returns>This returns all of the renters</returns>
        public IHttpActionResult Get()
        {
            RenterService renterService = CreateRenterService();
            var           renters       = renterService.GetRenters();

            return(Ok(renters));
        }
Пример #2
0
        public IHttpActionResult Get(int id)
        {
            RenterService renterService = CreateRenterService();
            var           renter        = renterService.GetRenterById(id);

            return(Ok(renter));
        }
Пример #3
0
        private RenterService CreateRenterService()
        {
            var userId        = Guid.Parse(User.Identity.GetUserId());
            var renterService = new RenterService(userId);

            return(renterService);
        }
        public RenterLeaserTransactionService(IRepositoryWrapper repositoryWrapper)
        {
            this.repositoryWrapper     = repositoryWrapper;
            this.transactionRepository = this.repositoryWrapper.TransactionRepository;

            this.renterRepository = repositoryWrapper.RenterRepository;
            this.leaserRepository = repositoryWrapper.LeaserRepository;

            this.leaserService = new LeaserService(this.leaserRepository);
            this.renterService = new RenterService(this.renterRepository);
        }
Пример #5
0
        public RenterController(IOptions <RoomForRentOptions> optionsAccessor, IRepositoryWrapper repositoryWrapper)
        {
            this.repositoryWrapper = repositoryWrapper;
            this.optionsAccessor   = optionsAccessor;
            this.ItemsPerPage      = optionsAccessor.Value.ItemsPerPage;

            this.renterRepository = repositoryWrapper.RenterRepository;
            renterService         = new RenterService(renterRepository);

            this.transactionService = new RenterLeaserTransactionService(repositoryWrapper);
        }