TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
siva nathan
793
828
232.1k
why we use this code in mvc entity framewirk
Jun 20 2017 12:05 PM
// GET: /Student/Create public ActionResult Create() { return View(); } // // POST: /Student/Create [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(Student student) { if (ModelState.IsValid) { db.Students.Add(student); db.SaveChanges(); return RedirectToAction( "Index" ); } return View(student); } // what is meant by model state.isvalid why we check before to add student. and why we use save changes() method here?
Reply
Answers (
2
)
Two DB(SQL Server and Sqlite) in Entity Framework Project.
how can i remove multiple if statement.?