Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] ContactViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            model = await ContactService.Update(model);

            return(Accepted(model));
        }
        public async Task <IActionResult> Contact(ContactViewModel model)
        {
            IActionResult result = View(model);

            if (ModelState.IsValid)
            {
                await ContactService.Update(model);

                result = RedirectToAction("Acknowledgment");
            }
            return(result);
        }