public ActionResult Create([Bind(Include = "Id,Name,Designation,Salary")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }
public ActionResult Signup(User model) { using (var context = new OfficesEntities()) { context.Users.Add(model); context.SaveChanges(); } return(RedirectToAction("Login")); }