System.Data.Entity.Core.EntityCommandExecutionException发生在EntityFramework.SqlServer.dll中但未在用户代码中处理

时间:2016-06-10 09:48:36

标签: asp.net-mvc

namespace EmployeeDemo.Controllers
{
    public class EmployeeController : Controller
    {
        // GET: Employee
        public ActionResult Details(int id)
        {
            EmployeeContext employeeContext = new EmployeeContext();
            Employee employee =
                      employeeContext.Employees.Single(emp => emp.ID== id);
            return View(employee);
        }
    }
}

0 个答案:

没有答案