Convert object to int in Linq Where clause
I'm trying to query a collection where a value of a DataColumn is equal to a number. Problem is, I can't convert an object to an int within a Linq query.
The error fires within the where clause. Any suggestions?
Is there a special syntax I'm not aware o开发者_StackOverflow社区f?
var datos = _dttMasterViewTransaction.AsEnumerable().Where(r => r["JEID"] == FundsID).Select(r => new EntityJESummary()
{
Test = r["test"]
}).ToList();
Special syntax? Does casting count?
_dttMasterViewTransaction.AsEnumerable().Where(r => (int)r["JEID"] == FundsID)
精彩评论