LINQ to Entities 不识别方法的解决方案
//这样不行
var BrushProducTimeout = aliexpressEntities.CP_BrushProduc.Where(p => p.isActive == true && p.productState == 2 && (4 * 60 - (DateTime.Now.Subtract((DateTime)p.doBrushProducTime).TotalSeconds)) <= 0).ToList();
换成下面的就可以
Expression<Func<CP_BrushProduc, bool>> where = p => p.isActive == true && p.productState == 2 && 4 * 60 - (DateTime.Now.Subtract((DateTime)p.doBrushProducTime).TotalSeconds) <= 0;
var BrushProducTimeout = aliexpressEntities.CP_BrushProduc.Where(where.Compile()).ToList();