15. Auto implemented properties Assembler will give you the code similar to the below namespace SampleLib { public class YesClass { // Fields [ CompilerGenerated ] private string <>k__AutomaticallyGeneratedPropertyField0 ; // Methods public YesClass (); public void DoNothing (); // Properties public string Reply { [ CompilerGenerated ] get; [ CompilerGenerated ] set; } } } How do you know this ? … Use any Reflector ..
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27. Lambda Expressions // Data source. int[] Scores = { 90, 71, 82, 93, 75, 82 }; Write me some code that returns me the count for the numbers that are greater than 80 ? // This query executes immediately because it returns a singleton int value, not an iterable sequence. int scoreQuery = Scores.Where(n => n > 80).Count();
28. Lambda Expressions // Data source. string[] Projects = { “eZCap”, “iMedsoft”, “Patient Portal”, “LiveWellHRA”, “ETL”, “iMedLiveWell”}; Write me some code that returns me the projects that has “Med” in project name ? IEnumerable<string> projsQry = from proj in projs where proj.Contains("Med") select proj; foreach (string projName in projsQry) { Console.WriteLine(projName); }