C# reflection, interfaces, abstract class, generics, ref vs out, C# versions 4,5,6 and features.

LINQ Where Filtering Operator

LINQ where operator comes in Filtering operators category. Here is a list of all LINQ Operators. Where operator filter the list based on some given criteria. Where operator is an extension method which accept a Func delegate as a parameter. Func accept only a single argument element. An element is passed to argument automatically by LINQ. In the predicate, we'll ...

Continue Reading

LINQ Filtering Operators with Examples in C#

Filtering operators are used to select only those elements from sequence that satisfy a condition. For example, suppose we have ten names in a collection sequence and we have to filter out those names that start with "K". Filtering Operators Description Where Filter elements based on the condition. OfType T...

Continue Reading

LINQ Query Operators

LINQ provides more than 50 query operators for different functionalities. Every query operator is an extension method. These operators can be categorized into following one: Operator Category LINQ Query Operators Names Filtering Where, OfType Sorting OrderBy, OrderByDescending, ThenBy, ThenByDescending Set ...

Continue Reading

LINQ Query Syntax and Method Syntax

LINQ provides two syntax for writing queries. Query syntax Method Syntax Query Syntax Query syntax is like SQL like query syntax. Query syntax is easier to read and write than Method syntax. But Query syntax does not support all query operators of LINQ. A query syntax must begin with a from clause. The from clause specify data source (sequence) from whic...

Continue Reading

LINQ Basics

Before we start learning LINQ language, we must learn some basic knowledge of most used concepts in LINQ. Sequence A sequence is any collection object that implements the IEnumerable<> interface. LINQ queries only works with the sequences. static void Main(string[] args) { List<string> countries = new List<string>(); countries.Add("In...

Continue Reading

LINQ Introduction

LINQ is an acronym for Language Integrated Query. LINQ is introduced in .NET 3.5. Before LINQ, developers need to use different languages for retrieving and saving different data sources. For example if you want to retrieve data from SQL or Oracle database you must learn some basics of SQL query language, and for retrieving data from XML files you need to learn XML parsers...

Continue Reading

Top LINQ Interview Questions and Answers - Part 2

Question 11. What is the use of into keyword in LINQ? 'into' keyword lets us save the intermediate result into a variable. We can further write LINQ query against this variable. static string[] names = { "Kapil Malhotra", "Michael Jackson", "Miami Sinha" }; static void Main(string[] args) { var result = from name in names ...

Continue Reading

Top LINQ Interview Questions and Answers - Part 1

Question 1. What is LINQ? LINQ stands for Language INtegrated Query. LINQ allows us to write queries over local collection objects and remote data sources like SQL, XML documents etc. We can write LINQ query on any collection class which implements the IEnumerable interface. Question 2. What is Sequence and Query Operators in LINQ? Sequence is a collection class on ...

Continue Reading

Top 10 C# / .NET OOPS Interview Questions and Answers

Question 1. What is Object Oriented Programming (OOPS)? OOPS is a technique to develop modules. These modules are assembled together as software. OOPS works on the objects. Everything in OOPS is object. Object is made up of states and behaviors. Objects communicate with each other by sending messages to each other. Object hierarchy are built using Aggregation and Composit...

Continue Reading

C# Barrier

C# Barrier class is synchronization primitives used in .NET threading. Barrier is used in an algorithm which composed of multiple phases.  In this Barrier synchronization, we have multiple threads working on a single algorithm. Algorithm works in phases. All threads must complete phase 1 then they can continue to phase 2. Until all the threads do not complete the p...

Continue Reading

Join our newsletter and get an occasional email with a technology and DotNetPattern.com news update.