Home > Net >  Where's the Contains (string []) should be how to write?
Where's the Contains (string []) should be how to write?

Time:09-15

Purpose is fields in the query biao pihao and string [] cm inside the same record
Var cm=new string [] {" 4831 ", "4832", "4833", "4830", "4820"};
Var query=the from ob in md. Baio
Where cm. All (objA. Pihao. Contains)
The select ob
So write wrong

CodePudding user response:

The cm. The Contains (objA. Pihao)

CodePudding user response:

The
reference 1/f, hands on the keyboard to knock very light response:
cm. The Contains (objA. Pihao)


Thanks for the second floor, is this way,

I have also tried to write you this, but at the back of the linq statement also has a problem, and later post

CodePudding user response:

The cm. The Contains (objA. Pihao) should be no problem,
If the error,
Method may be used in linq statement,
When the IQuerable, cannot use native methods,
Need ToList (), before use,

CodePudding user response:

If the back of the need to use the IQuerable need. ToList () instantiation
  •  Tags:  
  • LINQ
  • Related