[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include="Id,Reciever_Area,Parcel_Type,Delivery_Type,Parcel_Weight,Final_Cost")] quotation quotation)
{
if (ModelState.IsValid)
{
db.quotations.Add(quotation); <-- this isn't working
db.SaveChanges();
return RedirectToAction("Index", "Home");
}
return View(quotation);
}
This is the error message I get:
An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code
Additional information: The entity type quotation is not part of the model for the current context.
DbContextis not aware of theQuotationtype. I would need to know information about how you are generating yourDbContext(database first, code first) class before providing additional detail.