コード例 #1
0
        public IActionResult UpdateAdvertisement(int id)
        {
            Advertisement advertisement = _advertisementService.Get(id);

            AdvertismenetViewModel advertismenetViewModel = new AdvertismenetViewModel()
            {
                SelectCity = _utilities.SelectCity(),

                SelectRoom = _utilities.SelectRoom(),

                Title = advertisement.Title,

                Price = advertisement.Price,

                Balcony = advertisement.Balcony,

                RentOrSale = advertisement.RentOrSale,

                CityId = advertisement.CityId,

                SquareMeters = advertisement.SquareMeters,

                RoomId = advertisement.RoomId
            };

            return(View(advertismenetViewModel));
        }
コード例 #2
0
        public async Task <ActionResult <List <AdvertisementResponse> > > Get(AdvertisementsRequest request)
        {
            try
            {
                var res = await _advService.Get(request);

                return(new OkObjectResult(res));
            }
            catch (Exception exception)
            {
                _logger.LogError(exception.Message);
                throw exception;
            }
        }
コード例 #3
0
        public async Task <CustomApiResponse> Get(string id)
        {
            var result = _mapper.Map <AdvertisementsDto>(await _advertisementService.Get(id));

            return(new CustomApiResponse(result));
        }