C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Use Two where Condition in LINQ Query in C#
WhatsApp
Rajan Singh
Nov 16
2015
1.2
k
0
0
using
System;
using
System.Linq;
namespace
CSharpLINQ
{
class
SimpleQuery
{
static
void
Main()
{
int
[] numbers = {
1, -2, 3, -3, 0, -8, 12, 19, 6, 9, 10
};
var query = from n
in
numbers where n > 0 where n < 12 select n;
foreach
(var q
in
query)
Console.Write(
"{0}\t"
, q);
}
}
}
Answer:
1 3 6 9 10
LINQ
C#
Use Two where Condition in LINQ
Up Next
How to Use Two where Condition in LINQ Query in C#