LINQ to Objects in Depth (2) Query Methods (Operators) and Query Expressions
As fore mentioned, LINQ to Objects standard query methods (also called standard query operators) are provided as static methods of System.Linq.Enumerable type, most of which are IEnumerable<T> extensi
11231 words
|
56 minutes
LINQ to Objects in Depth (1) Local Sequential Query
LINQ to Objects queries .NET objects in local memory of current application or service. Its data source and the queries are represented by IEnumerable<T> interface, and it is executed sequentially. Th
1493 words
|
7 minutes
C# Functional Programming In-Depth (15) Pattern matching
Pattern matching is a common feature in functional languages. C# 7.0 introduces basic pattern matching in is expression and switch statement, including constant value as pattern and type as pattern, a
1628 words
|
8 minutes
C# Functional Programming In-Depth (12) Immutability, Anonymous Type, and Tuple
Immutability is an important aspect of functional programming. As discussed in the introduction chapter, imperative/object-oriented programming is usually mutable and stateful, and functional programm
4611 words
|
23 minutes
C# Functional Programming In-Depth (13) Pure Function
The previous chapter discusses that functional programming encourages modelling data as immutable. Functional programming also encourages modelling operations as pure functions. The encouraged purity
1789 words
|
9 minutes
C# Functional Programming In-Depth (11) Covariance and Contravariance
In programming languages with subtyping support, variance is the ability to substitute a type with a different subtype or supertype in a context. For example, having a subtype and a supertype, can a f
3492 words
|
17 minutes
C# Functional Programming In-Depth (10) Query Expression
C# 3.0 introduces query expression, a SQL-like query syntactic sugar for query methods composition.
1246 words
|
6 minutes
C# Functional Programming In-Depth (9) Function Composition and Chaining
As demonstrated in the introduction chapter, in object-oriented programming, program is modelled as objects, and object composition is very common, which combines simple objects to more complex object
5763 words
|
29 minutes
C# Functional Programming In-Depth (8) Higher-order Function, Currying and First Class Function
The delegate chapter and other previous chapters have demonstrated that in C#, function supports many operations that are available for object. This chapter discusses one more aspect, higher-order fun
4034 words
|
20 minutes
C# Functional Programming In-Depth (7) Expression Tree: Function as Data
C# lambda expression is a powerful syntactic sugar. Besides representing anonymous function, the same syntax can also represent expression tree. An expression tree is an immutable tree data structure
3195 words
|
16 minutes