Tag: LINQ
Defining Simple Anoymous Type in C#
To define an anonymous type in C# , we can use the var keyword . The syntax for defining the anonymous type in C# is as follows var <variableName> = <Non-NULL Value> Eg: var WebsiteName = “Abundantcode.com”; In the MSIL , the above code is similar to
VB.NET and LINQ – Filter elements from object collection using where clause
Here’s a sample code snippet demonstrating how to filter elements from a list of objects using the where clause using LINQ in VB.NET. This sample gets all the employees who salary is greater than 20000 GBP. How to Filter Employees List whose salary is greater than 20000 GBP using LINQ in VB.NET ? Output Employees whose salary is greater than 20000 pounds Michael John
How to check if List is Empty using LINQ in C#?
Below is a sample source code demonstrating the usage Any () and Count () to check if the list is empty in LINQ. How to check if List is Empty using LINQ in C#?
How to use SQL like Operator in LINQ and C#?
In a SQL Query, one might use the Like Query which can be used along with the % operator to search of contains within the data. How to use SQL like Operator in LINQ and C#? This article will show it with a sample code snippet. How to use SQL like Operator in LINQ and C#? Below is a sample source code demonstrating the usage…
How to Remove Duplicates in List using LINQ?
There are times when you have to remove duplicate entried from a List from Your C# program and one of the easiest way to do that is using the combination of the LINQ and IEqualityComparer interface. Assume that you have a list of Actors as shown below ID : 1 , Name = Vijay ,Language = TamilID : 2 , Name = Rajni ,Language =…
Popular LINQ for JavaScript libraries
Below are some of the popular LINQ for JavaScript libraries that allows the developers to query JavaScript objects using LINQ like syntax. Popular LINQ for JavaScript libraries jLinq linq.js – LINQ for JavaScript LINQ to JavaScript Reactive Extensions for Javascript $linq
Returning Dictionary from LINQ Query in C#
Below is a sample source code demonstrating how to return Dictionary of<int, string> from the LINQ Query result. Returning Dictionary from LINQ Query in C#
var keyword in Foreach Statement in C#
Below is a sample sourcecode demonstrating the usage of the var keyword within the indexes in the Foreach statement in c#. var keyword in Foreach Statement in C#
Popular LINQ Providers for .NET Developers
LINQ stands for Language Integrated Query . It enables the developers or the programmers to query against different data sources with the similar syntax. Below are some of the popular LINQ Providers for the .NET Developers. Popular LINQ Providers for .NET Developers Linq to Excel Linq to Google LINQ to Active Directory LINQ to AD LINQ to JavaScript linq.js – LINQ for JavaScript LINQtoCRM LINQ…