90 likes | 310 Views
C# Feature Refresh. Developer Knowledge Sharing Eric Sun Dec, 2007. What programming language did you learn in school and since then? Now, it’s time to refresh …. Test: Find Even Numbers. C# 1.x – Loop in Collection (Array) C# 1.x – Delegate (Custom Delegate)
E N D
C# Feature Refresh Developer Knowledge Sharing Eric Sun Dec, 2007
What programming language did you learn in school and since then?Now, it’s time to refresh …
Test: Find Even Numbers • C# 1.x – Loop in Collection (Array) • C# 1.x – Delegate (Custom Delegate) • C# 2.0 – Iterators (yield return) • C# 2.0 – Delegate (Predicate<T>) • C# 2.0 – Anonymous Method • C# 3.0 – Lambda Expression • C# 3.0 – LINQ (Language integrated Query) • C# 3.0 – Extended Method
Class/Type/Object • C# 1.x – Everything becomes class (OOP) • C# 1.x – Runtime Type Info / Reflection / CodeDom • C# 2.0 – Partial Class, Static Class • C# 3.0 – Anonymous Class • C# 3.0 – Implicit Type Variable • C# 3.0 – Object and Collection Initializers • C# 3.0 – Extended Method
Properties • C# 1.x – Introduced properties • C# 2.0 – Property access modifier • C# 3.0 – Automatic property • C# 3.0 – Object Initializers
Generics • Generics is the ability to have type parameters on type. They are also called parameterized types or parametric polymorphism. • Type Safe Collection: List<T> • EventArgs: EventHanlder<T> • Validation: IsInRange<T>(min, max) • Controller Demo: Presenter<T>
Lambda Expression • Lambda expression defines an anonymous function using the following syntax • One parameter: x => x + 1 • Two parameters: (x, y) => x * y • No parameter: () => new Test() • Expression Tree
LINQ • Select: Default, Anonymous Class, Dictionary • Where: Static, Dynamic Query • Group: Aggregation, e.g. count • Join: Inner Join, Out Join, Group Join • Order: e.g. order by count desc • Demo: Order – Appraiser Assignment
What’s Next • Once you learnt how to drive, what are the rules to be on the road? • Design Patterns • ASP.NET • Web Services / WCF • Smart Client / WPF • Q & A