public ActionResult Sharpp([Bind(Include = "Texto")] Sharpp _sharpp) { _sharpp.Autor = SessionService.Instance.GetUsuarioLogado().Username; _sharpp.Registro = DateTime.Now; _sharpp.Save(); return(RedirectToAction("Index")); }
public bool ExcluiSharpp(Sharpp _sharpp) { var sharpps = _sharpps.db.GetCollection <Sharpp> ("sharpps"); sharpps.DeleteOne(new BsonDocument("_id", _sharpp._id)); return(true); }
public ActionResult Create([Bind(Include = "Id,Autor,Texto,Registro,Like,Resposta")] Sharpp sharpp) { if (ModelState.IsValid) { _sharpp.PostSharpp(sharpp); return(RedirectToAction("Index")); } return(View(sharpp)); }
public bool ExcluiSharpp(Sharpp _sharpp) { db.Sharpps.Remove(_sharpp); db.SaveChanges(); return(true); }
public bool PostSharpp(Sharpp _sharpp) { db.Sharpps.Add(_sharpp); return(true); }
public bool PostSharpp(Sharpp _sharpp) { this._sharpps.collection.InsertOne(_sharpp); return(true); }