public ActionResult Comentar(FormCollection f)
        {
            Guid ID;
            if (Session["userid"] == null)
                ID = Guid.Empty;
            else
                ID = (Guid)Session["userid"];
            int id = Convert.ToInt32(f["id"]);
            BibliotecaDataContext db = new BibliotecaDataContext();
            if (f["coment"] != null && f["coment"] != "")
            {
                Comentario c = new Comentario() { Id_Cont = id, Id_Us = ID, Fecha = DateTime.Now, Texto = f["coment"] };

                db.Comentarios.InsertOnSubmit(c);
                db.SubmitChanges();
            }
            return Redirect("/Contenido/VistaLibro/" + id);
        }
        public ActionResult DetallePublicacion(FormCollection f)
        {
            Guid ID;
            if (Session["userid"] == null)
                ID = Guid.Empty;
            else
                ID = (Guid)Session["userid"];
            int id = Convert.ToInt32(f["id"]);
            BibliotecaDataContext db = new BibliotecaDataContext();

            ViewBag.tipo = (from p in db.Contenidos where p.IdContenido == id select p).ToArray()[0].Tipo;
            ViewBag.con=id;

            ViewBag.contenido = (from p in db.Publicacions where p.IdPublicacion == id select new { tema = p.Tema }).ToArray()[0].tema;
            if (f["coment"] != null && f["coment"] != "")
            {
                Comentario c = new Comentario() { Id_Cont = id, Id_Us = ID, Fecha = DateTime.Now, Texto = f["coment"] };

                db.Comentarios.InsertOnSubmit(c);
                db.SubmitChanges();
            }
            ViewBag.comentario=(from p in db.Comentarios where p.Id_Cont==id select p).ToList();
            ViewBag.cosa = (from p in db.Gustas where p.Id_Us==ID && p.IdPub==id select p).Count().ToString();
            Guid IDD = (Guid)(from p in db.Contenidos where p.IdContenido == id select p).ToArray()[0].Id_User;
            var y = (from i in db.Perfil_Usuarios where i.Id_User == IDD select i).ToArray()[0];
            ViewBag.avatar = y.Avatar;
            ViewBag.karma = y.Karma;
            ViewBag.userid = IDD;
            ViewBag.comcont = (from p in db.Comentarios where p.Id_Cont == id select p).Count();
            ViewBag.listas = (from i in db.Contenidos where i.Id_User == IDD select i).ToList();
            ViewBag.listauser = (from p in db.Perfil_Usuarios select p).ToList();
            ViewBag.gustas = (from i in db.Gustas where i.IdPub == id select i).Count();
            return View();
        }
 partial void DeleteComentario(Comentario instance);
 partial void InsertComentario(Comentario instance);
 partial void UpdateComentario(Comentario instance);
		private void detach_Comentario(Comentario entity)
		{
			this.SendPropertyChanging();
			entity.Usuario = null;
		}
		private void attach_Comentario(Comentario entity)
		{
			this.SendPropertyChanging();
			entity.Usuario = this;
		}
		private void detach_Comentario(Comentario entity)
		{
			this.SendPropertyChanging();
			entity.Publicacion = null;
		}
		private void detach_Comentarios(Comentario entity)
		{
			this.SendPropertyChanging();
			entity.Contenido = null;
		}
		private void detach_Comentarios(Comentario entity)
		{
			this.SendPropertyChanging();
			entity.aspnet_User = null;
		}