示例#1
0
        public IActionResult ContactMe(ContactMeMessage viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("Partials/_ContactPartial", viewModel));
            }

            _emailService.ContactMe(viewModel.Name, viewModel.Email, viewModel.Message);

            return(RedirectToAction(nameof(Index)));
        }
示例#2
0
 public JsonResult ContactMe([FromBody] ContactMeViewModel contact)
 {
     _emailService.ContactMe(contact);
     return(Json(new { Error = false, contact }));
 }