You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
1Every LINQ provider is different and will produce different SQL, so you really cannot generalize. Furthermore, "reasonably complex query operations" will often be impractical, if not impossible, to translate into LINQ - and more often then not, if it is even possible, it will be considerably more time consuming than just writing the SQL in the first place.quentin-starin– quentin-starin2012-01-06 06:36:27 +00:00Commented Jan 6, 2012 at 6:36
-
@qes: A good comment, but I doubt this. Cannot generalize? Is the generated T-SQL or the algorithms used to generate it from e.g. LINQ-to-SQL and Entity Framework, really so fundamentally different? By time-consuming here I assume you mean development time, not running time (i.e. the question)? Even still, not necessarily. For example, suppose your query involved concatenation, other string manipulation, iteration,with persistence of some state from one row to the next, and calls to trigonometry functions...T. Webster– T. Webster2012-01-06 06:48:05 +00:00Commented Jan 6, 2012 at 6:48
-
You doubt it? How many LINQ providers have you worked with? L2S and EF are only 2 of dozens, and both from Microsoft at that. The algorithms used are quite different (even from L2S to EF, heck even from one version of EF to the next) for anything but the simplest single table select statements - and those are of no interest to your question it would seem. It will be considerably more time consuming, yes, in development time - as you fight to make a complex SQL statement simply translate from LINQ at all. Even reasonably simple joins in SQL can be tricky or even impossiblequentin-starin– quentin-starin2012-01-06 06:52:18 +00:00Commented Jan 6, 2012 at 6:52
-
It seems you don't really understand how short most LINQ providers fall. String manipulation? Maybe 50/50 chance it's implemented. Iteration with persistence of state? Calling trig functions? Not happening. Use L2S, EF, SubSonic, LLBLGen, Lightspeed, etc. - at least a handful - and see what you find for yourself. And that's not even getting into using different LINQ providers against DB engines other than Microsoft SQL Server, another whole can of worms there.quentin-starin– quentin-starin2012-01-06 06:53:24 +00:00Commented Jan 6, 2012 at 6:53
-
1Trig & financial - Used in stored procs. Not in LINQ. So if your sproc uses them, you won't be easily translating them into a LINQ query. String functions, like I said - maybe 50/50. Some are supported, some providers are better than others (try your string functions in SubSonic and see how many work). My point is that the type of SQL you are asking about - "reasonably complex query operations" - are more often than not, not going to be possible to simply write in LINQ - and even when you can accomplish it - runtime performance is irrelevant since development time will be lengthened.quentin-starin– quentin-starin2012-01-06 08:07:55 +00:00Commented Jan 6, 2012 at 8:07
|
Show 8 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-sql