0

I have two string which i have to iterate through linq ?

I have status as column and its having row value of

     Status
    --------
    Int
    String
    Boolean
    Char
    Float

LINQ

 var result = from desc in result
 where desc.Status == "string" && desc .Status == "Int"
 select desc ;

How to achieve this .. I have tried but it returns empty. If i try with single check its working correctly.

2 Answers 2

5

You need to use || operator

where desc.Status == "string" || desc .Status == "Int"
Sign up to request clarification or add additional context in comments.

1 Comment

@AravindanSrinivasan, At one point of time you can only have one value. it can be either string or int. Please elaborate
1
var result = from desc in result
             where new[] {"Int","String","Boolean","Char","Float"}.Contains(desc.Status)
                         select desc ;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.