38
1
using System;
2
using System.Linq;
3
using System.Collections.Generic;
4
5
6
public class Program
7
{
8
public static void Main()
9
{
10
// Student collection
11
IList<Student> studentList = new List<Student>() {
12
new Student() { StudentID = 1, StudentName = "John", Age = 13} ,
13
new Student() { StudentID = 2, StudentName = "Moin", Age = 21 } ,
14
new Student() { StudentID = 3, StudentName = "Bill", Age = 18 } ,
15
new Student() { StudentID = 4, StudentName = "Ram" , Age = 20} ,
16
new Student() { StudentID = 5, StudentName = "Ron" , Age = 15 }
17
};
18
19
Func<Student,bool> isTeenAger = delegate(Student s) {
20
return s.Age > 12 && s.Age < 20;
21
};
22
23
var filteredResult = from s in studentList
24
where isTeenAger(s)
25
select s;
26
27
foreach (var std in filteredResult)
28
Console.WriteLine(std.StudentName);
29
}
30
}
31
32
public class Student{
33
34
public int StudentID { get; set; }
35
public string StudentName { get; set; }
36
public int Age { get; set; }
37
38
}
Cached Result
Compilation error (line 14, col 20): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 14, col 40): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 14, col 51): The name 'Path' does not exist in the current context
Compilation error (line 14, col 64): The name 'Path' does not exist in the current context
Compilation error (line 14, col 86): The name 'Assembly' does not exist in the current context
Compilation error (line 14, col 142): The name 'FileMode' does not exist in the current context
Compilation error (line 15, col 20): The type or namespace name 'BinaryReader' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 42): The type or namespace name 'BinaryReader' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 21, col 69): The name 'textBox1' does not exist in the current context
Compilation error (line 23, col 13): The name 'richTextBox1' does not exist in the current context
Compilation error (line 28, col 59): The name 'richTextBox1' does not exist in the current context
Compilation error (line 28, col 78): The name 'textBox1' does not exist in the current context
Compilation error (line 31, col 20): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 31, col 41): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 31, col 52): The name 'Path' does not exist in the current context
Compilation error (line 31, col 65): The name 'Path' does not exist in the current context
Compilation error (line 31, col 87): The name 'Assembly' does not exist in the current context
Compilation error (line 31, col 147): The name 'FileMode' does not exist in the current context
Compilation error (line 32, col 20): The type or namespace name 'BinaryWriter' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 32, col 42): The type or namespace name 'BinaryWriter' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 51, col 38): The name 'Encoding' does not exist in the current context
Compilation error (line 52, col 43): The type or namespace name 'Rfc2898DeriveBytes' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 55, col 51): The type or namespace name 'RijndaelManaged' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 58, col 45): The name 'CipherMode' does not exist in the current context
Compilation error (line 59, col 48): The name 'PaddingMode' does not exist in the current context
Compilation error (line 62, col 59): The type or namespace name 'MemoryStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 64, col 63): The type or namespace name 'CryptoStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 64, col 101): The name 'CryptoStreamMode' does not exist in the current context
Compilation error (line 70, col 71): 'System.Array' does not contain a definition for 'Concat' and no extension method 'Concat' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 71, col 71): 'System.Array' does not contain a definition for 'Concat' and no extension method 'Concat' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 88, col 68): 'System.Array' does not contain a definition for 'Take' and no extension method 'Take' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 90, col 66): 'System.Array' does not contain a definition for 'Skip' and no extension method 'Skip' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 92, col 68): 'System.Array' does not contain a definition for 'Skip' and no extension method 'Skip' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 94, col 43): The type or namespace name 'Rfc2898DeriveBytes' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 97, col 51): The type or namespace name 'RijndaelManaged' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 100, col 45): The name 'CipherMode' does not exist in the current context
Compilation error (line 101, col 48): The name 'PaddingMode' does not exist in the current context
Compilation error (line 104, col 59): The type or namespace name 'MemoryStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 106, col 63): The type or namespace name 'CryptoStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 106, col 101): The name 'CryptoStreamMode' does not exist in the current context
Compilation error (line 112, col 44): The name 'Encoding' does not exist in the current context
Compilation error (line 123, col 41): The type or namespace name 'RNGCryptoServiceProvider' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 14, col 40): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 14, col 51): The name 'Path' does not exist in the current context
Compilation error (line 14, col 64): The name 'Path' does not exist in the current context
Compilation error (line 14, col 86): The name 'Assembly' does not exist in the current context
Compilation error (line 14, col 142): The name 'FileMode' does not exist in the current context
Compilation error (line 15, col 20): The type or namespace name 'BinaryReader' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 15, col 42): The type or namespace name 'BinaryReader' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 21, col 69): The name 'textBox1' does not exist in the current context
Compilation error (line 23, col 13): The name 'richTextBox1' does not exist in the current context
Compilation error (line 28, col 59): The name 'richTextBox1' does not exist in the current context
Compilation error (line 28, col 78): The name 'textBox1' does not exist in the current context
Compilation error (line 31, col 20): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 31, col 41): The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 31, col 52): The name 'Path' does not exist in the current context
Compilation error (line 31, col 65): The name 'Path' does not exist in the current context
Compilation error (line 31, col 87): The name 'Assembly' does not exist in the current context
Compilation error (line 31, col 147): The name 'FileMode' does not exist in the current context
Compilation error (line 32, col 20): The type or namespace name 'BinaryWriter' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 32, col 42): The type or namespace name 'BinaryWriter' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 51, col 38): The name 'Encoding' does not exist in the current context
Compilation error (line 52, col 43): The type or namespace name 'Rfc2898DeriveBytes' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 55, col 51): The type or namespace name 'RijndaelManaged' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 58, col 45): The name 'CipherMode' does not exist in the current context
Compilation error (line 59, col 48): The name 'PaddingMode' does not exist in the current context
Compilation error (line 62, col 59): The type or namespace name 'MemoryStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 64, col 63): The type or namespace name 'CryptoStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 64, col 101): The name 'CryptoStreamMode' does not exist in the current context
Compilation error (line 70, col 71): 'System.Array' does not contain a definition for 'Concat' and no extension method 'Concat' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 71, col 71): 'System.Array' does not contain a definition for 'Concat' and no extension method 'Concat' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 88, col 68): 'System.Array' does not contain a definition for 'Take' and no extension method 'Take' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 90, col 66): 'System.Array' does not contain a definition for 'Skip' and no extension method 'Skip' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 92, col 68): 'System.Array' does not contain a definition for 'Skip' and no extension method 'Skip' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Compilation error (line 94, col 43): The type or namespace name 'Rfc2898DeriveBytes' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 97, col 51): The type or namespace name 'RijndaelManaged' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 100, col 45): The name 'CipherMode' does not exist in the current context
Compilation error (line 101, col 48): The name 'PaddingMode' does not exist in the current context
Compilation error (line 104, col 59): The type or namespace name 'MemoryStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 106, col 63): The type or namespace name 'CryptoStream' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 106, col 101): The name 'CryptoStreamMode' does not exist in the current context
Compilation error (line 112, col 44): The name 'Encoding' does not exist in the current context
Compilation error (line 123, col 41): The type or namespace name 'RNGCryptoServiceProvider' could not be found (are you missing a using directive or an assembly reference?)