Esempio n. 1
0
        public ActionResult BidsForLot(int lotId)
        {
            LotService ls     = new LotService();
            LotDTO     lotDto = new LotDTO();

            lotDto.BidsForLot = (List <BidDTO>)ls.AllBidsForLot(lotId);

            var config     = new MapperConfiguration(cfg => cfg.CreateMap <BidDTO, BidsForLotViewModel>());
            var mapper     = new Mapper(config);
            var bidsForLot = mapper.Map <List <BidsForLotViewModel> >(lotDto.BidsForLot);

            return(View(bidsForLot));
        }
Esempio n. 2
0
        public ActionResult LotInformation(LotViewModel lotViewModel)
        {
            LotService bs     = new LotService();
            LotDTO     lotDto = new LotDTO();

            lotDto.BidsForLot = (List <BidDTO>)bs.AllBidsForLot(lotViewModel.LotId);

            var config     = new MapperConfiguration(cfg => cfg.CreateMap <BidDTO, BidsForLotViewModel>());
            var mapper     = new Mapper(config);
            var bidsForLot = mapper.Map <List <BidsForLotViewModel> >(lotDto.BidsForLot);

            lotViewModel.BidsForLot = (List <BidsForLotViewModel>)bidsForLot;
            return(View(lotViewModel));
        }