Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ID, SavedRecipeID, Comment, Name")] Comments comments)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _context.CreateComment(comments);

                    return(RedirectToAction(nameof(View)));
                }
                return(RedirectToAction(nameof(View)));
            }
            catch (Exception)
            {
                return(Redirect("https://http.cat/500"));
            }
        }