我试图从我正在使用EF5的数据库中检索多个非实体对象,并编写以下内容
using (FluoraPinEntities context = new FluoraPinEntities()) {
string mQuery = @"select EMAIL,FIRST_NAME,USER_ID from USERS where EMAIL=\'" + mail + "\'";
foreach (DbDataRecord rec in new ObjectQuery<DbDataRecord>(mQuery, context))
{
string x = rec[0].ToString();
Console.WriteLine("ID {0}; Name {1}", rec[0], rec[1]);
}
}
我得到以下错误无法从实体框架转换为
1- system.data.objects.objectcontext