public async Task<IActionResult> UpdateVilla(int villaId)
{
var response = await _villaService.Get<APIResponse>(villaId);
if (response != null && response.IsSuccess)
{
VillaDTO model = JsonConvert.DeserializeObject<VillaDTO>(Convert.ToString(response.Result));
return View(_mapper.Map<VillaUpdateDTO>(model));
}
return NotFound();
}
this code is for updating the details of Villa. i’ve added a breakpoint at this method and found out when i click on update button, it get the id of that specific villa, but “response”
is passing null and shows this error:
No webpage was found for the web address: https://localhost:7002/Villa/UpdateVilla?villaId=3
HTTP ERROR 404
as you can see, it gets the villaId, but response will be null
i need to mention this update method works 100% fine in API project and problem is from MVC Project. (i have API & MVC in separated Projects)
Here i added a breakpoint to get method and it seems ok to me
it also doesn’t hit the break point for update method
and shows me this 404 Error
let me know if you need any other details or code should i provide to you