|
Never use Linq to SQL.
If you are developing in ASP.Net MVC, i think you can use Entity Framework 6 or 7.
ORMS have really gotten better in the past few years, and there is not a lot you can't do with them.
EF7 infact has improved performance comprd to 6 but still has some missing features.
|
|
|
|
|
|
What's with all the LinqToSQL hatred?
|
|
|
|
|
My applications all use stored procedures and queries in which I make full use of joins and variables to do what I need. Linq often makes very simple tasks much simpler, but the strong datatyping of Linq sometimes makes slightly more complicated things impossible to code or impossible to debug, and my code grows tremendously to get what would otherwise be simple things done.
|
|
|
|
|
I don't disagree with anything you've written. I frequently have code with LinqToSQL and without. No reason you can't mix in the same project.
I just don't get the blanket 'never use it' sentiment that some people have shown.
|
|
|
|
|
I have used both Entity Framework and NHibernate extensively. I would say that if you are using the ASP.NET 5 (ASP.NET CORE) technology then EF7 is a good tool but if you aren't using the cutting edge ASP.NET tech then I prefer NHibernate but EF 6 will work as well. Please note, EF7/ASP.NET 5 (CORE) are not out of beta yet...
Like others have pointed out, this also depends on your project. From my recollection, NHiberante has the ability to connect to a lot more data providers so if you need to integrate with MySQL, MsSQL, Oracle, etc. in the same project then NHiberante might be a better choice.
Food for though
Eric
|
|
|
|
|
NHibernate and other (Open Source and Commercial) Libraries are good.
I had a case, where I consider to use a very previous version of NHibernate, but, couldn't, due to switching between VS versions, and poor documentation.
NHibernate was my first choice, but, have to drop all of them in favor of a custom ORM, which to be honest, was difficult to implement. Wish NHibernate had better documentation and examples at that time...
|
|
|
|
|
|
I'm currently using nHibernate with FluentNHibernate. I like it, for easy queries from tables. Having said that, I'm trying to get rid of it and switch to Dapper. My website has gotten way to complex for nHibernate queries. I have to do anywhere from 3 to 30 SEPARATE calls to the database just to get all of the data for my view model. That's AWFUL, and one of the huge downsides to non-asynchronous ORM's. At my work, we use an ORM-lite, similar to Dapper. It is AWESOME! You write all of the stored procedures to access all database information, it's fully asynchronous, AKA FAST! I recommend something like Dapper.
|
|
|
|
|
Use the one you "like".
I use Entity Framework "Code First" for all my prototyping; big or small.
I deal with a lot of XML related services / data imports.
With EF and Visual Studio, I can take XML data and definitions, and generate a fully loaded SQL Server databases that can be accessed in any number of ways, including LINQ to Entities, in under 30 minutes. I don't even have to think about whether there is an easier way.
The original model can subsequently be expanded upon using partial classes; leaving the original model intact (and simple).
|
|
|
|
|
|
|
Easy: Fame and Glory of course
No, honest: I do it for my own sake. My memory is so poor that I know the next time I've got the same problem, I can't remember how the heck I solved it. Thus: Better to write an article or a tip as a reminder to your future self...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Johnny J. wrote: I do it for my own sake. My memory is so poor that I know the next time I've got the same problem, I can't remember how the heck I solved it. Same here. Fortunately most of the time I can remember in which project I already solved it and can look it up from there. Just didn't find the time to finish any of the articles I started for those things..
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
That is what I figured T&T was for, when it first started I happily began entering my one liners that I found useful. Then it evolved into a mini article suppository and I got shouted at for the minimalist content.
Having just spent 2 hours ratting through 15 applications trying to locate something I did 5 years ago in Silverlight which I now want to apply to a WPF app I can understand your need!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That is also my opinion on what T&T is for. Some moderators get too carried away in my opinion. But surely a man of your reputation can enter T&T's without moderation?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Ooh, my first reason to answer on Quora. Thanks Nish.
This space for rent
|
|
|
|
|
You are welcome. Quora would benefit from some POHian wisdom.
|
|
|
|
|
Nish Nishant wrote: POHian
The Last of the POHians - I think I saw that movie once...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Needed more scath.
veni bibi saltavi
|
|
|
|
|
The same reason I was writing tips and articles about CP/M and the Amstrad PCW series for free for actual paper publications back in the late 80s, I would imagine. Nobody was ever going to pay for them!
I am not a number. I am a ... no, wait!
|
|
|
|
|
Speak for yourself, I got paid for code I got published in Amstrad Action[^]
|
|
|
|
|
Corollary: Why are so many people posting questions on Quora when they are blatantly not qualified to handle anything sharper than a crayon?
I would say there are in the region of 5%-10% of the questions worth reading and of those maybe the same rate are worth answering. Reminds me of somewhere else[^]
veni bibi saltavi
|
|
|
|
|
|
The reasons for the tremendous efforts poured into CP, and, indeed, Quora, have to with the fact that we are in the final Kalpa of the great cosmic Yuga cycle where the Darker Feminine Principle of Devi manifests as Kali, The Merciless, The Destroyer of Order, of Syllogistic Reasoning, of Patriarchy.
It is a time when galaxies, planets, nations, societies, families, begin to fade back into the hallucinatory shadows of immaterial god-fluff they really are, when all moral order disintegrates, when all forms of security prove inadequate to prevent the inevitability of death being salient to every conscious entity.
As William Blake said in "The Four Zoas: Night the Eighth:" “All futurity seems teeming with endless destruction never to be repelled; Desperate remorse swallows the present in a quenchless rage.”
People strive to escape the relentless ominous cataclysm with all kinds of distractions from collecting Barbie Dolls, to writing for CodeProject, to gluttony, violence, suicide, terrorism, drug addiction, playing video games ...
But, the good news is that Kalki is going to be sent down here by Vishnu to clean house; and then, the whole she-bang can start over, with a fresh slate, and that clean-all-over minty feeling.
Have a nice day.
cheers, Bill
«In art as in science there is no delight without the detail ... Let me repeat that unless these are thoroughly understood and remembered, all “general ideas” (so easily acquired, so profitably resold) must necessarily remain but worn passports allowing their bearers short cuts from one area of ignorance to another.» Vladimir Nabokov, commentary on translation of “Eugene Onegin.”
|
|
|
|