In the first query, I query list of steps for an ID. In the next query I check to see if that query contains an ID from new Query and C_S_Is_Button. But I get this error below. I have seen similar issues on this site but I havent figured out how to implement a solution into my problem.
Error:
The type arguments for method
‘System.Linq.Enumerable.Contains(System.Collections.Generic.IEnumerable,
TSource)’ cannot be inferred from the usage. Try specifying the type
arguments explicitly.
First Query
var QcheckA = from csd in l.LCSDatas
join cls in l.LCSteps on csd.C_S_ID equals cls.C_S_ID
join cde in lol.LCDefinitions on csd.C_S_ID equals cde.C_S_ID
where csd.A_ID == _AID && cde.C_ID == data.C_ID
select new
{
csd.C_S_ID
};
C Step. Find lowest step where button hasnt been clicked.
var QSID = (from cd in l.LCDefinitions
join cs in l.LCSteps on cd.C_S_ID equals cs.C_S_ID
where cs.C_S_Is_Button == true
&& cd.C_ID == data.C_ID
&& !QcheckA.Contains(cd.C_S_ID) //Error Here
orderby cd.C_S_Order ascending
select new
{
cd.C_S_ID
}).Take(1);
var SID = QSID.SingleOrDefault();
Any suggestions for this situtation? Thanks
You are creating an anonymous type in the first query and then in the second query you are trying to essentially compare an anonymous class type to a base type like an
intor aGuid.In your first query try to be more explicit (cast it to the exact type it is, I’m assuming
intbut you might be using aGuid):Then, in your second query, create another anonymous type that is like the first being explicit on what type of property it contains: