Exemplo n.º 1
0
        public async Task <IActionResult> Create(Testimonial testimonial)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    bool result = await _repo.Add(testimonial);

                    if (result)
                    {
                        return(RedirectToAction("Index"));
                    }
                    return(View("Create"));
                }
                catch
                {
                }
            }
            return(RedirectToAction("Error", "Home"));
        }