|
I'm using nHibernate now and I don't like it.. for the very same reasons Pete pointed out.
I've always been a big fan of Linq-To-Sql.. for the very same reasons Pete pointed out.
If it's not broken, fix it until it is
|
|
|
|
|
Use the repository pattern and you can swap in/out ORM to suit yourself.
|
|
|
|
|
If you are using ASP.NET MVC, Entity Framework would be the recommended ORM framework.
|
|
|
|
|
The question you should ask yourself is, which technology is most likely to land you the next job.
What, me cynical?
|
|
|
|
|
I have previously written applications that don't use ORM, but did use it in a recent project. I disagree with most of the others, in that I found it very beneficial to use. It doesn't stop you doing other stuff if you need to, but makes many aspects of database interaction much, much easier.
In my case it was the entity framework I used.
Cookie
|
|
|
|
|
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
|
|
|
|