public IActionResult Create(CreateCommentViewModel createComment) { ViewData["recipeId"] = createComment.RecipeId; if (!ModelState.IsValid) { return(View(createComment)); } _recipeService.AddComment(createComment); return(RedirectToAction("Details", "Recipe", new { id = createComment.RecipeId })); }
public IActionResult AddRecipieComment([FromBody] RecipeComment recipeComment) { var response = _RecipeService.AddComment(recipeComment).Result; return(new OkObjectResult(response)); }