I think one issue here is that, essentially, the answer breaks down as:
- I wrote a blog, here it is
- My blog has relevant information about X
- My blog has relevant information about Y
- My blog has relevant information about Z
- Oh, this one line could be faster in your code.
Now, on Code Review, and on Stack Exchange in general, links are allowed if they provide supporting information to your post. This has been discussed many times in many places, even in the meta faq. Of significance, in the 'how to answer' link in the help/how-to-answer it says:
Provide context for links
Links to external resources are encouraged, but please add context
around the link so your fellow users will have some idea what it is
and why it’s there. Always quote the most relevant part of an
important link, in case the target site is unreachable or goes
permanently offline.
The reason that context is needed, is because, if the link rots, is offline, or the user is firewalled in some way, or another, the answer still needs to make sense.
So, let's take the answer, and make the link '404', what's left?
I recently wrote an article on this subject:
http:404somewhere/whatever
Should I be putting LINQ query expressions inside of an object's properties?
Sure, if doing so makes sense and does not violate the guidelines in
my article above.
Without the article, that makes no sense ... what guidelines?
Where do I draw the line with this?
Read my article for guidelines, and read the Framework Design
Guidelines.
Without the article, that makes no sense ... what Framework Design Guidelines?
I assume db access is probably too far but is there a line, or just a gray area?
These are guidelines, not rules. The guideline for speed, for example,
is that a property getter should not be much more than ten times
slower than fetching a field.
Without the article, that makes no sense... what guidelines?
Do you see any issues with my usage of LINQ?
Yes. This is potentially inefficient:
Issues.Where(x => x.name == "Warnings").Count() > 0;
Here is 1 line of code that is being reviewed...
You don't need to count how many pennies are in a jar to know if there
are more than zero, you only need to count one of them. You should say
Issues.Where(x => x.name == "Warnings").Any()
Now, about that 1 line of code, Eric answered at: 19:38:08Z
3 hours before that, at 16:49:30Z, Jesse commented:
Though, consider replacing Issues.Where(x => x.name == "XXX").Count() > 0 with Issues.Any(x => x.name == "XXX"). Still LINQ, but much more concise.
And, the first point, in the second, and accepted answer (by Olorin71 at 17:50:02Z - 2 hours before Eric's answer) says:
- As Jesse said, I'd use Any instead of Where + Count. It should have a better performance, I think.
Summing up
The first 75% of Eric's answer is link-only since it makes no sense without the link.
The remaining 25% is a duplicate of other content posted hours before, and content so minor that the first person to mention it put it as a comment...
The way I see it, is that this answer is useless as a review as it adds nothing, and the only person who will benefit from it is Eric because it requires that users 'click through' before the non-redundant part of the answer makes any sense.
But, despite all that, it's not spam.