Example #1
0
        public async Task <IActionResult> Create([FromBody] RegisterInputDto registerinput)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var result = await TuristPlaceCategoryServise.Register(registerinput);

            return(Ok(result));
        }
        public async Task <IActionResult> OnPost()
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(Page());
                }
                await turistPlaceCategoryServise.Register(registerInput);

                State = true;
                return(RedirectToPage("./TuristPlaceCategory"));
            }
            catch (Exception e)
            {
                State             = false;
                ViewData["Error"] = e.Message;
                return(Page());
            }
        }