예제 #1
0
        public async Task <IActionResult> Update(int id)
        {
            var place = await _placeProvider.GetAsync(id);

            var plVm = _mapper.Map <PlaceViewModel>(place);

            return(View(plVm));
        }
예제 #2
0
        public async Task <IActionResult> Info(int id)
        {
            try
            {
                var placeInfo = await _placeProvider.GetAsync(id).ConfigureAwait(false);

                var offers = await _offerProvider.GetOffersAsync(null, null, id, true, 1, null);

                var aggregate = new PlaceInfoAggregate()
                {
                    Place  = _mapper.Map <PlaceViewModel>(placeInfo),
                    Offers = offers.Cast <OfferInfo>().ToList()
                };

                return(new ObjectResult(aggregate));
            }
            catch
            {
                return(BadRequest());
            }
        }