我正在这个链接的帮助下开发一个应用程序:
http://www.binaryintellect.net/articles/9a5fe277-6e7e-43e5-8408-a28ff5be7801.aspx
在生成 BasicDetails 视图时,出现此错误:
Unable to retrieve metadata for WebApplication.Models.BasicInfo
这是我的连接字符串:
<add name="CompanyEntity" connectionString="metadata=res://*/Models.Employee.csdl|res://*/Models.Employee.ssdl|res://*/Models.Employee.msl;provider=System.Data.SqlClient;provider connection string="data source=myservername;initial catalog=Company;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings>
我在 MVC5 中创建这个应用程序。
我的 BasicInfo 类:
public class BasicInfo
{
public string EmpName { get; set; }
public string CompName { get; set; }
}
我在 EmployeeController 类中的 BasicInfo:
public ActionResult BasicInfo(BasicInfo Details, string BtnPrevious, string BtnNext)
{
if (BtnNext != null)
{
if (ModelState.IsValid)
{
Employee ObjEmp = GetEmployee();
ObjEmp.EmployeeName = Details.EmpName;
ObjEmp.CompanyName = Details.CompName;
return View("AddressInfo");
}
}
return View();
}