Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Get all employees by location and id using LINQ

It was asked by a 500+ rep user, immediately received seven downvotes, and was deleted by the OP.

But it's not a bad question at all. In fact, before EF 4.0, there was no support for checking if an item is in a list. See: Entity Framework and IN operator: justified dissappointment? One C# expert even wrote an extension to allow this, and it's far from trivial.

Since EF 4.0, you can use the Contains function in a LINQ Where clause, but that's far from obvious.

Why does this question merit 7 downvotes? Are people shooting from the hip after a cursory glance?

share|improve this question
He added what he tried eight minutes after posting. Way too late. This was "give me the codez" question. And yes, people are shooting really fast at such questions. – Shadow Wizard May 13 '13 at 12:53

The question you see now is not the question the OP posted at first. That is, a significant part was added after several minutes. Before, the question boiled down to:

I want to convert this is into a LINQ expression, I am a beginner to LINQ and EF, can someone guide me into writing this into LINQ?

It is not difficult to see how this might have been interpreted as one of the unpopular "Give me teh codez" type questions. And those tend to attract downvotes. And especially so when asked within a very active tag-community.

The second revision added

This is what I have so far:

var supervisors = (from employee in Employee
         where employee.location_OID == "???"  //I have ID's in a list here
         select employee.Employee_OID).Any();

While one might argue that this is not a big change in amount of content, it at the very least shows the OP is trying to resolve his own problems and not necessarily relies on us to do so. That is, he is no longer asking us to solve his problem, but asking us to help him solve his own problem. And that makes the question a whole lot better.

All in all I would say this is not about any perceived triviality of the problem, nor users shooting from the hip. A little bit of care on behalf of the OP when posting this question, taking a bit more time to make it a good one, would have most likely, at the very least somewhat reduced the amount of downvotes.

share|improve this answer
The question is about fairly general issues people run into when using EF, but the title did not mention them. Perhaps a more specific title will help. – Andomar May 13 '13 at 13:28
If you can (help) improve the question, by all means do do. It's still not a great one I'd say, and it seems on its way to closure. – Bart May 13 '13 at 13:33
One of the problems I find with the site is that down-voting a question can often be set-it-and-forget-it. I know there is a feature request somewhere (can't find it right now) but there is no way for me to see a list of questions I've down-voted, so unless I bookmark each one, there is no way for me to go back and check if the post has been improved. – Aaron Bertrand May 13 '13 at 13:41
@AaronBertrand You can do that by looking in 'votes' under your user profile.… – George Stocker May 13 '13 at 13:45
@George ah, thanks, I wasn't aware of that! Now if only I could find the feature request that asked for this, I know I read it recently, but can't seem to find it now. That said, it would be nice to have some kind of visual cue in that list that would let me know if a post has been modified since my vote. – Aaron Bertrand May 13 '13 at 14:05
Here's another one The given close reason is "not a real question", which is not rational. If SO encourages this behavior, there should be close reasons for "I personally don't like this question" or "The OP is a slacker" – Andomar May 13 '13 at 15:58
@Andomar What is the "real question" there? It's a "I want this" statement with zero effort. No question is asked. We're not rent-a-coder. – Bart May 13 '13 at 16:02
It's a practical programming problem. It's downvoted because people think it's easy to figure out with a bit of effort. But it's not. Even if you took a regular SQL course, I doubt you would learn about count(distinct col1). – Andomar May 13 '13 at 16:24
Yet another example – Andomar May 14 '13 at 13:18
@Andomar If you feel they somehow strengthen the point of your question, why not add them there? Here in the comments they will go largely unnoticed, except for me. And I'm sorry, but I'm on the closing side for each of them so far. – Bart May 14 '13 at 13:36
@Andomar Your "another example" is a typical "give me teh codez" question. – Kermit May 14 '13 at 13:55
@FreshPrinceOfSO: In SQL at least, failed attempts have little value. Many people will not know row_number() and there is no obvious way to learn about it. Most people who downvote those questions couldn't even answer them. – Andomar May 14 '13 at 14:24
@Andomar Perhaps some research may have lead them to row_number() – Kermit May 14 '13 at 14:26
@FreshPrinceOfSO: By "research", I suppose you mean Google. I assist many people in IRL. Although many are highly educated and intelligent, few of them can find row_number() with Google. – Andomar May 14 '13 at 15:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .