Answers for "c# Linq IN"

C#
0

where in used in linq c#

var myInClause = new string[] {"One", "Two", "Three"};

var results = from x in MyTable
              where myInClause.Contains(x.SomeColumn)
              select x;
// OR
var results = MyTable.Where(x => myInClause.Contains(x.SomeColumn));
Posted by: Guest on August-17-2021
0

linq c#

List<int> collection1 = new List<int>() { 1, 2, 3 };
List<int> collection2 = new List<int>() { 4, 5, 6 };

var collection3 = collection1.Concat(collection2);

foreach (int i in collection3)
    Console.WriteLine(i);
Posted by: Guest on July-06-2021

C# Answers by Framework

Browse Popular Code Answers by Language