public ActionResult AddComment(string text, Guid idPhoto) { Photo photo = Binder.GetAllPhoto().FirstOrDefault(i => i.IDPhoto == idPhoto); var user = AuthHelper.GetUser(HttpContext); if (text != null) { Comment comment = new Comment() { PhotoId = idPhoto, UserId = user.idUser, Like = 0, Text = text }; Binder.AddComment(comment); } idPhoto = photo.IDPhoto; return RedirectToAction("GetPhotoView", "File", new { idPhoto }); //return RedirectToAction("Profile", "User", user); }
public static bool AddComment(Comment comment) { return bll.AddComment(comment); }