Language Integrated Query (LINQ) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, although ports exist for Java, PHP, JavaScript and ActionScript.

learn more… | top users | synonyms

2
votes
1answer
148 views

Is it okay to convert dataset from stored procedure to IEnumerable

So, I am working on a project with a team and we are using Entity Framework. We basically want to use linq to entities, and not use stored procedures. I use quite a bit of lists and IEnumerables and ...
2
votes
2answers
155 views

Style for creating IEnumerable unions

There isn't any cool LINQ sugar for creating unions. The Enumerable.Union() method is usually called like this: var bigList = list1.Union(list2); The alternative is to call Enumerable.Union() which ...
11
votes
3answers
700 views

What problem domain is LINQ made for?

Each time I see a question posted on Stack Overflow on C#, I see at least one or two answers posted that solve a problem with LINQ. Usually people with very high reputation seem to use LINQ like pros. ...
2
votes
2answers
388 views

Is it better to create a stored procedure or entities to get to the data I need?

I just jumped into a new project with a new company using Entity Framework and ASP.NET MVC 4. I am no expert on Entity Framework, but I think I have a decent grasp of how to use it. From what I can ...
34
votes
5answers
3k views

for vs. foreach vs. LINQ

When I write code in Visual Studio, ReSharper (God bless it!) often suggests me to change my old-school for loop in the more compact foreach form. And often, when I accept this change, ReSharper goes ...
3
votes
1answer
166 views

Algorithm to optimize grouping

I would like to know if there's a known algorithm or best practice way to do the following: I have a collection with a subcollection, for example: R1 R2 R3 -- -- -- M M M N N L L A What i ...
3
votes
5answers
210 views

Using 'new' in a projection?

I wish to project a collection from one type (Something) to another type (SomethingElse). Yes, this is a very open-eneded question, but which of the two options below do you prefer? Creating a new ...
2
votes
1answer
719 views

Nesting Linq-to-Objects query within Linq-to-Entities query –what is happening under the covers?

var numbers = new int[] { 1, 2, 3, 4, 5 }; var contacts = from c in context.Contacts where c.ContactID == numbers.Max() | c.ContactID == numbers.FirstOrDefault() ...
3
votes
1answer
123 views

Are elements returned by Linq-to-Entities query streamed from the DB one at the time or are they retrieved all at once?

Are elements returned by Linq-to-Entities query streamed from the database one at the time ( as they are requested ) or are they retrieved all at once: SampleContext context = new ...
3
votes
4answers
272 views

What is the most effective order to learn SQL Server, LINQ, and Entity Framework?

I am trying to get some advice on what order I should learn about SQL Server, LINQ, and Entity Framework to be able to better work with ASP.NET Webforms and MVC. From what I've been able to learn so ...
2
votes
1answer
274 views

Better way to read XML

We are storing config files as XML. With that being said, when reading the XML file, is it better to use LINQ to query the XML file or would using the XMLDocument and/or XMLNode classes better to use? ...
57
votes
12answers
5k views

Why is the use of abstractions (such as LINQ) so taboo?

I am an independent contractor and, as such, I interview 3-4 times a year for new gigs. I am in the midst of that cycle now and got turned down for an opportunity even though I felt like the ...
2
votes
1answer
436 views

Best way to remove list items from an existing record

Ok more of a conceptual question here: Say I have an existing record of type Meeting. When I go to edit the meeting I have a listbox with all current meeting participants, and one with all employees. ...
-2
votes
2answers
638 views

How do I tell the cases when it's worth to use LINQ?

Many things in LINQ can be accomplished without the library. But for some scenarios, LINQ is most appropriate. Examples are: SELECT - ...
4
votes
1answer
250 views

What is Rainbow (not the CMS)

I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools: dapper and a bunch of custom ...
7
votes
2answers
689 views

Does LINQ require significantly more processing cycles and memory than lower-level data iteration techniques?

Background I am recently in the process of enduring grueling tech interviews for positions that use the .NET stack, some of which include silly questions like this one, and some questions that are ...
3
votes
1answer
196 views

Test bed application for executing LinQ queries against AdventureWorks

I am looking for a "test bed" application which will help me to learn Linq by writing queries and immediately executing them against the AdventureWorks database. Why AdventureWorks? Because it is a ...
0
votes
2answers
823 views

LINQ TO SQL or ADO.NET? [closed]

What is the best choice LINQ TO SQL (.DBML) or using ADO.NET with procedures for a database with 29 tables and about 30 concurrent users that will run the system that I am going to build? I know that ...
4
votes
3answers
962 views

Is querying KeyValue Pairs efficient compared to two-property objects?

I'm working on a webservice and I'm returning JSON. However, I'm returning a List<KeyValuePair<string, int>>, since that's all I'm really ever going to be dealing with (property => value) ...
4
votes
2answers
597 views

MVVM Reporting App Approach ? Data Access Layer?

I'm trying to follow the MVVM pattern in a reporting / statistics application that I'm making in C# / WPF. I have made many model classes to hold properties as a starting point. Some of these models ...
3
votes
1answer
404 views

Any changes/improvement for LINQ 2010 vs LINQ 2008

I'm VB.NET user and now learning LINQ. The book I'm reading now focus on LINQ 2008 VB.NET. I want to know whether there are changes/improvement in LINQ 2010? p/s: I'm reading this book: Pro LINQ ...
3
votes
3answers
797 views

T-SQL stored procs orders of magnitude faster than LINQ

According to answers I've seen on stackoverflow, stored procedures (and to a lesser extent db functions) tend to perform better vs. LINQ + ORM frameworks (e.g. Entity Framework). I want to determine ...
-2
votes
1answer
296 views

Book for LINQ in VB.NET [duplicate]

Possible Duplicate: Books for LINQ in VB.NET I want to learn LINQ and I only know VB.NET. Please recommend a book for me. Thanks.
1
vote
2answers
637 views

Best practice modelling an active record entity using Linq-To-SQL as DAL

Currently I'm starting a new system on my company, and we are using a good separation between models, views and controllers, basically using Asp.Net MVC 3 for the user UI, and a C# class library for ...
-3
votes
7answers
348 views

Selling LINQ To Management

I recently started working at a new company that currently doesn't use linq, but does use C# and the .net framework. I'm coming from a LINQ background, so I'm biased, but I still think there are a ...
5
votes
1answer
8k views

Entity Framework vs. Linq to SQL? [closed]

I'm a little bit confused about these two terms "Linq to SQL" and "Entity Framework". I have the general idea that both of them somehow allow you to refer to database tables as .net objects or ...
7
votes
4answers
1k views

LINQ vs Data Access Layer

I've taught myself always to handle any data access code in a completely separate 'layer' to my business logic and UI code. This has always been a very good architecture for me and any 'rules' or best ...
14
votes
7answers
7k views

What's the best Java equivalent to Linq?

Are there any libraries in Java that come close to providing the functionality of Linq?
4
votes
3answers
580 views

LINQ to SQL - Business logic in another assembly?

So I am trying my hand at this whole tiered application thing with ASP.NET 4. The software I've developed is a maintenance nightmare and it isn't very well organized. I've done some looking around ...
10
votes
5answers
2k views

Is the potential performance hit from LINQ worth it for improved readability?

We are considering using LINQ (to Objects) in our (commercial grade) projects where performance may be an issue. I have heard it may impact performance, but then the code is so much more readable and ...
5
votes
3answers
964 views

Will there be any official LINQ like lambda based library for C++?

Given C++('11) has lambdas now, will there be any LINQ like higher order function library officially supported later? Is there any such library now being used in any production level code? Obviously ...
9
votes
6answers
627 views

As a new programmer, how much time should I spend learning new libraries?

As a junior programmer, how much time should I spend focusing on new libraries or language features, as opposed to learning how things worked before those libraries came about? How dangerous is it to ...
6
votes
3answers
785 views

Best algorithm/practice when creating a search mechanism for your database?

I have been designing a database where it is very important to provide users with a good search mechanism. So I was wondering what some of the best practices are for using keywords to search over ...
4
votes
3answers
462 views

Is LinqPad site quote “Tired of querying in antiquated SQL?” accurate?

I was struck by the heading Tired of querying in antiquated SQL? on http://www.linqpad.net/. I am a N-Tier application developer and learnt my trade in a company that worked with a lot of data, ...
0
votes
3answers
376 views

Are there any good resources for refactoring existing C# code to use LINQ while keeping your tests passing?

I've been teaching myself a little LINQ and an exercise I thought would be useful was to take my existing Project Euler C# code, which I built using Test Driven Development and gradually convert it to ...
10
votes
9answers
1k views

LINQ Style preference [closed]

I have come to use LINQ in my every day programming a lot. In fact, I rarely, if ever, use an explicit loop. I have, however, found that I don't use the SQL like syntax anymore. I just use the ...
1
vote
2answers
243 views

C# Linq to <blank> which type is most used and which are most hated/unneeded

I have read and used many good Linq to . I have also read that some of the Linq to __ are not worth learning as there are better techniques. I was just wondering which of the bunch should I ...
7
votes
4answers
2k views

Displaying code in Power Point (or other presentation software)?

I'm going to be introducing LINQ to my co-workers next week. I'm starting with an existing method from our production code and slowly converting it to use LINQ. I don't want to take the time to ...
0
votes
1answer
108 views

Comparing features in a asp.net web application using different database methodologies

I have a webstore which sells components (it is a academic project) which looks like this. I have developed the same web application using following database methodologies: MS Sql Server with Stored ...
14
votes
11answers
6k views

Senior Interview LINQ questions

I'm preparing a LINQ section in interview questions for senior programmers. What are the most interesting questions in LINQ to include? And why?
7
votes
3answers
4k views

In ASP.NET MVC3 controllers, where do you instantiate your DataContext?

In your ASP.NET MVC 3 applications that use a DataContext or DbContext, where do you instantiate your data access object? Here is a non-exhaustive list of where I've seen it done: Individually ...
18
votes
5answers
2k views

MVC, WCF, EF, LINQ - Is it just me? [closed]

...or are things getting more complicated? It seems to me that you need to know a lot of stuff to 'properly' develop an MS web app these days. In the bad old days when we didn't know any better we ...
7
votes
5answers
1k views

LINQPad still being used much out there? [closed]

I'm trying to guage how popular and how used LINQPad is today. I'm just wondering if it's still a useful tool or not as VS and other tools have gotten better. Furthermore, I am coding over LLBGen by ...
3
votes
4answers
1k views

Should I be learning Linq, Direct SQL Commands (in .net), EF or other?

Basically, I have a very good knowledge of plain old SQL coming from Classic ASP programming. Over the past couple of months, I have been learning C# and today was my first full day at MVC 3 (Razor) ...
11
votes
4answers
873 views

What would you think about a new Java persistence tool, that's not really an ORM? [closed]

Persistence in Java Over the past years, I have gathered experience in the field of persistence abstraction in Java, using concepts such as EJB 2.0, Hibernate, JPA and home-grown ones. They seemed to ...
31
votes
9answers
6k views

Does the usage of LINQ and Lambda Expressions lead to less readable code?

I'm having a discussion with a co-worker on Linq, I'll copy here: Co-Worker: Lets be honest here. Linq syntax sucks. It's confusing and non-intuitive. Me: oh come on, more confusing ...