10. Native to the CLR Allow for better type safety increasing performance (no box, unbox, casting) ArrayList vs. List<T> IDE Magic What are Generics?
11. *200% perf gain value types (i.e.-string, int…) *100% perf gain ref types (i.e.-MyClass) Used throughout .NET Make great containers i.e.-List<T> Activator.CreateInstance<T>() Uses / Benefits * - #’s from MSDN
12. C# List<string> x = new List<string>(); String GetValueAsString<T>(T entity) {} VB.NET Dim x As New List(Of String) Function GetValueAsString(of T)(ByRef entity As T) As String Syntax
16. ? Extension Methods “Extension methods enable you to ‘add’ methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.” -MSDN
17. Allows adding methods to an existing type No recompile needed Can extend framework classes (including sealed) Methods included in Intellisense Extension Methods
19. ? Lamda Expressions “A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.” -MSDN
34. Summary - Wherever a delegate type can be used Event handlers LINQ Projection Extensions (Select, SelectMany) Find Extensions (Find, FindAll) When Can We Use Them?
36. ? Language Integrated Query (LINQ) “LINQ is a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. .” -MSDN
38. Expression based var results = from process in Process.GetProcesses() where process.ProcessName.Contains("WINWORD") orderbyprocess.MainWindowTitle descending select process; Method based varresults = Process.GetProcesses() .Where(process=>process.ProcessName .Contains("WINWORD")) .OrderBy(x=>x.MainWindowTitle); LINQ Options
40. LINQ C# VB Other Languages .NET Language – Integrated Query LINQ enabled data sources LINQ enabled ADO.NET LINQ to Objects LINQ to XML LINQ to Datasets LINQ to SQL LINQ to Entities Objects Relational Data XML
41. LINQ to … LINQ to Objects LINQ to XML (XLINQ) LINQ to DataSets LINQ to SQL (DLINQ) LINQ to Entities (EF) LINQ to SharePoint LINQ to REST LINQ to NHibernate LINQ to Twitter LINQ to SQL Saturday???