I have the following code, but I can’t work out what I need to put in place of the // before .AddObject(Model); and .SaveChanges(); to get the method to work. It’s a create query but I’ve only ever done this while using the Entity Framework before now, in this case I’m not using EF.
[HttpPost]
public ActionResult Registration(UserDetailModel Model)
{
if (ModelState.IsValid)
{
Model.UserNameFK = User.Identity.Name;
Model.CompanyName = "CompanyName";
Model.IEMI = "IEMI";
//.AddObject(Model);
//.SaveChanges();
return RedirectToAction("Registration", "Home");
}
return View(Model);
}
Am I close?
Cheers,
Mike.