예제 #1
0
        public async Task <IActionResult> LinkToLeaser([FromRoute(Name = "id")] int renterId)
        {
            RenterLeasersLinkDto linkDto
                = await renterLeaserTransactionService.GetPotentialLeasersDto(renterId);

            return(View(linkDto));
        }
        internal async Task <RenterLeasersLinkDto> GetPotentialLeasersDto(int renterId)
        {
            var renter = await this.renterRepository
                         .GetRenterByIdAsync(renterId);

            var leasers = await this.transactionRepository
                          .GetUnlinkedLeasers(renterId);

            var linkDto = new RenterLeasersLinkDto
            {
                Renter  = renter,
                Leasers = leasers,
            };

            return(linkDto);
        }