Is linq different from linq to sql?

I saw that some kind of linq code was used when moving the dictionary object in C #. I thought linq is for linq only for sql for databases. The linus used in the above code was a select statement, not a database.

Is there linq without linq for sql for databases? Is this "linq" without "sql" here to stay? I ask because people are talking about an entity framework replacing linq with sql, but of course EF does not replace linq, which is used in the mod I described? Can you use ef on a dictionary object? Hope for comments. Thanks.

This is where I saw him:

How to find duplicate pairs in a dictionary?

+4
source share
4 answers

Linq is a .NET-based technology for querying objects (something that implements IEnumerable). Linq to SQL is an extension that allows you to query SQL Server databases.

Yes, Linq, without SQL, remains here. This is an incredible technology. One of the best things, IMO, is to get out of Redmond for a long time.

+6
source

LINQ stands for "Language Integrated Query" and is not just a way to query SQL databases:

http://msdn.microsoft.com/en-us/library/bb397926.aspx

From the above link:

LINQ introduces standard, easily recognizable patterns for querying and updating data, and the technology can be expanded to support potentially any data warehouse.

LINQ is now used across the entire .NET platform, and, as you mentioned in your question, you can use it against your own collection types. For me, this completely changed the way I write code:

List<int> myIntList = new List<int>(); .... populate with some data myFilteredIntList = myIntList.Where(i => i > 10); 

In addition to LINQ to SQL, there are LINQ for objects, LINQ to XML, and LINQ to ADO.net.

Microsoft is actively investing in the LINQ feature set, and it remains here ... that, as they say, LINQ-to-SQL looks like it will eventually be deleted in favor of LINQ to ADO.Net (also known as Linq for objects ): http://blogs.msdn.com/b/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx

+5
source

LINQ itself is just a template that is supported by language extensions such as query expressions. An implementation working on List<T> , etc., commonly known as LINQ to Objects; LINQ to SQL and LINQ to EF are database implementations via IQueryable<T> . Reactive Extensions provides an implementation on IObservable<T> and IQbservable<T> . Parallel extensions provide an implementation for parallel processing of ParallelQuery<T> . All of them just work with a template supported by language methods such as Where and Select with the appropriate parameters that can be created from lambda expressions.

Note that LINQ to XML is a little strange here - it is not the LINQ provider itself; it's just an XML API that works especially well with LINQ to Objects.

+3
source

This is sometimes called "LINQ to Objects", but yes, the LINQ structure itself remains here and is based on both LINQ-to-SQL and the LINQ-to-Entities / Entity Framework.

LINQ works by implementing extension methods on IEnumerable<T> and IQueryable<T> . Anything that implements IEnumerable<T> (that is, all shared collections [with transformations available for non-shared collections]) can be used as a LINQ query source.

+3
source

All Articles