Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Re: http://stackoverflow.com/questions/194930/how-do-i-use-linq-containsstring-instead-of-containsstring#194939
- static void Main(string[] args) {
- var table = new[] {
- new { uid = 1 },
- new { uid = 2 },
- new { uid = 3 },
- new { uid = 4 },
- new { uid = 5 }
- };
- var stringarray = new[] { "1", "5", "10" };
- var results = from xx in table
- where stringarray.Contains(xx.uid.ToString())
- select xx;
- foreach (var result in results) {
- Console.WriteLine("Result: " + result.uid.ToString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement