LINQ to Entities无法识别方法' Int32 ToInt32(System.String)'方法
System.Web.Security.MembershipUser mu = System.Web.Security.Membership.GetUser();
string ID = mu.ProviderUserKey.ToString();
if(db.resume.Where(x => x.employeeID ==Convert.ToInt32(ID)).Count() == 0)
答案 0 :(得分:1)
如异常消息中所述,表达式中不支持Convert.ToInt32
。只需将其移出表达式:
System.Web.Security.MembershipUser mu = System.Web.Security.Membership.GetUser();
string ID = mu.ProviderUserKey.ToString();
int IID = Convert.ToInt32(ID);
if( db.resume.Where(x => x.employeeID == IID).Count() == 0 )