Wednesday, November 28, 2018

Collection constructor with collection initialzer

You can pass anything that is a valid constructor parameter. For example, List permits construction from any enumerable, so you can do this:

this combination notation is useful if you want to clone an existing collection and then make some tweaks to it.

Wednesday, November 14, 2018

Real world Use Case Linq Aggregation

Problem statement

We want to process numbers and categorized them into categories. This could be any data and we want to classify them based on requirement. Just to create small proof of concepts here is the sequence of numbers and idea is to classify them into even, odds and so on.

Solution Statement

Linq Aggregate with Union to show them all.

Class Diagram


Implementation Details

Number Class


Enum NumberType 

NumberGroup Classes




INumberGroup



NumberFilter Class



Main Calling Function
This is it!