Beispiel #1
0
        public async Task <IActionResult> Create([FromBody] AddPlaceInputDto addinput)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var result = await TuristPlaceService.AddTuristPlace(addinput);

            return(Ok(result));
        }
Beispiel #2
0
        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());
            }
        }