public ActionResult Create([Bind(Include = "UserId,Password,Fullname,Email,Joined,Active")] Person person) { if (ModelState.IsValid) { db.Person.Add(person); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(person)); }
public ActionResult SignUp(Person model) { using (var context = new TwitterCloneDbContext()) { context.Person.Add(model); context.SaveChanges(); } return(RedirectToAction("login")); }
public ActionResult EditTweet(int id, string userId, TWEET tweet) { var p = db.Person.FirstOrDefault(t => t.user_id == userId); var tw = db.TWEETs.FirstOrDefault(a => a.tweet_id == id); tw.message = tweet.message; db.SaveChanges(); return(RedirectToAction("Index", "Home", p)); }
public void SetMessage(Tweet obj) { db.Tweet.Add(obj); db.SaveChanges(); }
public void SetMessage(TWEET obj) { db.TWEETs.Add(obj); db.SaveChanges(); }