-1
안녕하세요. EF/MVC4 개발자 여러분;Entity Framework 5.0의 데이터베이스에서 레코드를 편집하는 방법
Cannot implicitly convert type 'System.Data.EntityState' to 'System.Data.Entity.EntityState' . An explicit conversion exists(are you missing a cast?)
public ActionResult Edit(int id, Employee employee)
{
try
{
using(InformationContext context = new InformationContext())
{
context.Entry(employee).State = System.Data.EntityState.Modified;
context.SaveChanges();
}
return RedirectToAction("Index");
}
catch
{
return View();
}
}
엔티티 프레임 워크에있을 때? System.Data.Entity.EntityState는 EF6 용이고 System.Data.EntityState.Modified는 EF5 용입니다. – AndersNS