当我这样做时:
var db = new NotentoolEntities();
IQueryable<GroupOfBranches> queryGOB = db.tabGroupOfBranches.Cast<GroupOfBranches>().Where(x => x.intGroupID.Equals(ID));
List<GroupOfBranches> GOB = new List<GroupOfBranches>(queryGOB); //here is the error
我遇到以下错误:
A first chance exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll
可能考虑将您的代码更改为
using (var db = new NotentoolEntities())
{
var GOB = db.tabGroupOfBranches.Where(x => x.intGroupID == ID).Select(y => new GroupOfBranches
{
/// here specify your fields
}).AsNoTracking().ToList();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句