/// <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)); }
public IHttpActionResult Get(int id) { RenterService renterService = CreateRenterService(); var renter = renterService.GetRenterById(id); return(Ok(renter)); }
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); }
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); }