public PartialViewResult _ComentariosForMovie(Comentario Comentario, int id = 0) { //Save the new Comentario Comentario.MovieId = id; db.Comentarios.Add(Comentario); db.SaveChanges(); //Get the updated list of Comentarios var Comentarios = from c in db.Comentarios where c.MovieId == id select c; //Save the MovieId in the ViewBag because we'll need it in the view ViewBag.MovieId = id; //Return the view with the new list of Comentarios return PartialView("_ComentariosForMovie", Comentarios.ToList()); }
public PartialViewResult _Create(int id = 0) { //Create the new Comentario Comentario newComentario = new Comentario(); newComentario.MovieId = id; newComentario.UserName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(User.Identity.Name); ViewBag.MovieId = id; return PartialView("_CreateAComentario"); }