public async Task <IActionResult> Create([FromBody] AddPlaceInputDto addinput) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await TuristPlaceService.AddTuristPlace(addinput); return(Ok(result)); }
public async Task <IActionResult> OnPost() { try { if (!ModelState.IsValid) { return(Page()); } await turistPlaceService.AddTuristPlace(placeinput); State = true; return(RedirectToPage("./Place")); } catch (Exception e) { State = false; ViewData["Error"] = e.Message; return(Page()); } }