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)); }
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; } }
public async Task <CustomApiResponse> Get(string id) { var result = _mapper.Map <AdvertisementsDto>(await _advertisementService.Get(id)); return(new CustomApiResponse(result)); }