Query objects, databases, and XML with expressive operators. Learn deferred execution, projections, grouping, joins, performance tips, and idiomatic LINQ patterns that make data code concise and powerful.
1,228 posts662 contributors
In this article, I will demonstrate the exciting new additions to LINQ extension methods introduced in.NET 6: MinBy() and MaxBy(). Let's explore how these powerful methods simplify code, providing efficient solutions for selecting extreme values within a generic sequence.
Learn how LINQ compiled queries create reusable delegates, reduce query-compilation overhead, and improve performance for frequently executed or complex queries.
Misconceptions about the four LINQ methods. Single(), SingleOrDefault(), First(), and FirstOrDefault(). This article addresses misconceptions surrounding four LINQ methods—Single(), SingleOrDefault(), First(), and FirstOrDefault(). Clarifying differences and potential pitfalls helps prevent null references and invalid operator exceptions in code.
LINQ (Language Integrated Query) is a powerful feature in C# that allows developers to query data from various data sources in a unified way. Here's a brief explanation of how LINQ can be used to query databases using LINQ to SQL or Entity Framework:
Below is the linq query and i want list in Order by Descending ensure = (from resultlist in db.application join flow in db.line on resultlist.appcode equals flow.applnno where resultlist.distcode == distcode && resultlist.status.Trim() == "LDT" && flow.deptcode == deptcode && (flow.status == null) select new linedeptmodel { applnno = resultlist.appcode, applicantname = resultlist.appname, doorno = resultlist.appaddrplotdoorno, street = resultlist.appaddrstreet, city = resultlist.appaddrcity, pincode = resultlist.appaddrpincode, sitedoorno = resultlist.siteaddrplotdoorno == null ? resultlist.siteplotno : resultlist.siteaddrplotdoorno, sitestreet = resultlist.sitea
This article is an informative and in-depth exploration of LINQ (Language Integrated Query) within the context of C#, a widely used programming language in the software development industry. The guide delves into both the query syntax and method syntax aspects of LINQ, providing readers with a thorough understanding of how to effectively use LINQ to query and manipulate data in C# applications.
select ROW_NUMBER() over (order by m.Id) RowNumber, ROW_NUMBER() over (partition by m.Rack order by m.Id) Rankvendor, m.Id, m.Rack, m.Capacity, s.BatchId, s.SampleQty from [MstStorage] M LEFT JOIN [tblStorageBatch] S ON M.Id=S.StorageId ---------------My Linq Code------------------------ List<TestRetensionList> _TestRetensionList = new List<TestRetensionList>(); try { _TestRetensionList = (from MstStorage in _dbContext.MstStorage.Where(k => k.IsActive == ApplicationData.IsActive) join TblStorageBatch in _dbContext.TblStorageBatch on MstStorage.Id equals TblStorageBatch.StorageId into TblStorageBatch from m1 in TblStorageBatch.DefaultIfEmpty() select new {  
In this article I will try to explain how to use projections in LINQ with a collection of objects.
LINQ is a powerful feature in modern programming languages like C# that allows developers to perform queries on different types of data sources using a consistent syntax. With LINQ, you can query and manipulate data without worrying about the underlying data source, whether it's an in-memory collection, a database, or XML
Using the OrderBy and OrderByDescending Operator in LINQ: Sorting Collections
This article will cover LINQ to SQL basics for beginners to understand the framework and the underlying workings of the LINQ to SQL.
In this article, you will learn about LINQ. Language Integrated Query (LINQ) provides a way to query any type of data source. LINQ simplifies this situation by offering a consistent model for working with data across various kinds of data sources and formats.
This article is the next article in LINQ learning tutorials which will cover LINQ to XML basics.
In this article, you will learn about the basics of programming logic.
Here, you will learn how to work with inner join using Linq and Lambda
Learn how LINQ element operators return a single item from a collection, including ElementAt, First, Single, Last, and their OrDefault variants.
select ROW_NUMBER() over (partition by m.Rack order by m.Id) RackWiseSerialNo, m.Id, m.Rack, m.Capacity, s.BatchId, s.SampleQty from [MstStorage] M LEFT JOIN [tblStorageBatch] S ON M.Id=S.StorageId ------- My Code is like _TestRetensionList = (from MstStorage in _dbContext.MstStorage.Where(k => k.IsActive == ApplicationData.IsActive) join TblStorageBatch in _dbContext.TblStorageBatch on MstStorage.Id equals TblStorageBatch.StorageId into TblStorageBatch from m1 in TblStorageBatch.DefaultIfEmpty() select new { Id = MstStorage.Id, Row = MstStorage.Row,  
LINQ stands for Language Integrated Query. In this article, we will dive deep into the basics of LINQ.
LINQ stands for Language Integrated Query. LINQ is a data querying API that provides querying capabilities to .NET languages with a syntax similar to a SQL. LINQ queries use C# collections to return data.
LINQ introduces a standard, unified, easy-to-learn approach for querying and modifying data. In this article, you'll learn basics of LINQ and how to use LINQ in C#.
select Count(*) from [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN DATEADD(day, 1, GETDATE()) AND DATEADD(day, 2, GETDATE()))
SELECT Count(*) FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN GETDATE() AND DATEADD(day, 1, GETDATE())) SELECT Count(*) FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN dateadd(day,-8,GETDATE()) AND GETDATE()) SELECT Count(*) FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn >DATEADD(day, 1, GETDATE()))