Exemple #1
0
        public async Task <IActionResult> Post([FromBody] LocalDTO local)
        {
            //await Service.Insert(local);
            //return Ok(true);
            if (!ModelState.IsValid)
            {
                throw new Exception("Model is not Valid");
            }
            await Service.Insert(local);

            return(Ok(true));
        }
Exemple #2
0
        public ActionResult Create(Local loc)
        {
            bool rpta = localservice.Insert(loc);

            if (rpta)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }