Skip to main content

Posts

Showing posts with the label Linq Distinct on a particular Property

What is LINQ API?

In the LINQ, the collections of the extension methods for the classes that implements IQueryable<T> and IEnumerable<T> interface. The Enumerable class includes extension methods for the class that implement IEnumerable<T> interface. The IQueryable class includes extension methods for the class that implement IQueryable<T> interface. The IQueryable interface inherits from IEnumerable interface, so whatever IEnumerable can do, IQueryable can also do. IQueryable <T> and IEnumerable <T> interfaces are used for data manipulation in LINQ from the database and collections. Points to Remembers :- We are using the namespace “ System.Linq ” to access LINQ and it is included by default in the added class. The LINQ API includes two important static classes Queryable and Enumerable and the Queryable and Enumerable class includes extension methods that implements interface i.e. ·        ...

LINQ Advantages and Disadvantages in .Net

The LINQ is stands for Language Integrated Query and it is a Microsoft .NET Framework component and use for data querying and it was released in .NET Framework 3.5 on November 19, 2007. The advantages and disadvantages for LINQ (Microsoft .Net) as give below in the details, Advantages 1.       It is quick turnaround for development. 2.       It is helps us to access any type of resource. 3.       It is a cleaner and type-safety. 4.       Lambda expressions are awesome. I am so happy to use it and I always recommended to others developers to use it. 5.       LINQ to SQL allows for RAD with database very nicely. 6.       Queries can be dynamically 7.       Declarative approach makes queries easier to understand and more compact. 8.       Extensibility and expression...

LINQ Architecture in ASP .Net C#

The LINQ has a 3 layered Architecture. In the upper layer consists of the language extensions and the bottom layer consists of data sources that are typically objects implementing IEnumerable <T> or IQueryable <T> generic interfaces. The LINQ contain some major components, 1.       LINQ to Objects. 2.       LINQ to ADO.NET, which includes. 3.       LINQ to SQL (formerly called DLinq). 4.       LINQ to DataSet (formerly called LINQ over DataSet). 5.       LINQ to Entities. 6.       LINQ to XML (formerly called XLinq). The LINQ Architecture show as below,

LINQ Tutorial for beginners in ASP.Net C# Examples

What, Why and How LINQ? What is LINQ? Why LINQ? What are LINQ Query and Method Syntax? What is Lambda expression? LINQ Architecture In ASP.Net? LINQ Advantages and Disadvantages? What is LINQ API? Understanding Var and IEnumerablewith LINQ IEnumerable Vs. IList IEnumerable Vs. IQueryable LINQ - Query Operators Where OfType OrderBy and OrderByDescending ThenBy and ThenByDescending Select All and Any Contains Aggregate Average GroupBy ToLookup Join GroupJoin Sum Max ElementAt and ElementAtOrDefault First and FirstOrDefault ...

Linq Distinct on a particular Property

Linq Distinct on a particular Property public List < Customers > Customer() {     List < Customers > result = base .Context.IDEP_Customers. GroupBy (x => x.erpCustomerId). Select (y => y.First()).ToList();     return result; }