I am working on a User registration form in MVC. Using the Entity framework , I linked my database with the project by creating an ADO model. As a part of saving the data to the table, I added a Httppost method in the controllet. Below is the snippet:
[HttpPost]
public ActionResult registration(u_user usermodel)
{
using (InCredibleModel models = new InCredibleModel())
{
models.u_user.Add(usermodel);
models.SaveChanges();
}
ModelState.Clear();
ViewBag.SuccessMessage = "Sign Up successfull!!!";
return View("Registration", new u_user());
}
Here InCredibleModel is the name of the data model that I created when linking my database. But this model is treated type/namespace and it is throwing me "Type/namespace could not be found" error. How to fix this?