1 / 9

C# Feature Refresh

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)

adamma
Download Presentation

C# Feature Refresh

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C# Feature Refresh Developer Knowledge Sharing Eric Sun Dec, 2007

  2. What programming language did you learn in school and since then?Now, it’s time to refresh …

  3. 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

  4. 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

  5. Properties • C# 1.x – Introduced properties • C# 2.0 – Property access modifier • C# 3.0 – Automatic property • C# 3.0 – Object Initializers

  6. 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>

  7. 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

  8. 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

  9. 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

More Related