public async Task <IActionResult> EditAdvertisement([FromBody] Advertisement advertisement)
        {
            var _advertisement = await _advertisementRepository.EditAdvertisement(advertisement);

            if (_advertisement == null)
            {
                return(NotFound("Anúncio não encontrado"));
            }
            else
            {
                return(Ok(_advertisement));
            }
        }
        public async Task <IActionResult> Editad(int Adid, [Bind("Adid,Userid,Ondisplay,Title,Rental,PostalCode,ContactPerson,ContactPhoneNum,Description,Country,Province,City,Streetname,Streetnum,Bedroomsnum,Bathroomsnum,Hydro,Heat,Water,Internet,Parkingnum,Agreementtype,Moveindate,Petfriendly,Size,Furnished,Laundry,Dishwasher,Fridge,Airconditioning,Smokingpermit")] AdvertisementModel advertisement)
        {
            if (Adid != advertisement.Adid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                advertisement.Userid = _userService.GetUserId();
                int returnAdid = await _advertisementRepository.EditAdvertisement(advertisement);

                return(RedirectToAction(nameof(GetAdvertisement), new{ Adid = returnAdid }));
            }
            return(View(advertisement));
        }