public ActionResult List() { using (VPopContext db = new VPopContext()) { return View(db.Messages.ToList()); }; }
public List<Message> GetMessages() { using (var db = new VPopContext()) { return db.Messages.ToList(); } }
public ActionResult Admin(Message message) { Session["Message"] = message.Text; var x =new DAL.PictureManager(); x.PutMessage("Mikes Key", "1", message.Text); using (VPopContext db = new VPopContext()) { db.Messages.Add(message); db.SaveChanges(); return Content("Saved"); } }