|
It most certainly is - but that's apples and oranges.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I have heard of Dapper, and that is about all. I have the most experience with EF but I am not going on the record to say that it is the best. I'm sure there are applications best suited for Dapper.
I found this to be interesting. The conclusion at the end is the most important. Dapper looks to be faster in a lot of respects. Interesting.
Don't Panic Labs – Speed Comparison: Dapper vs Entity Framework[^]
Looks like Stackoverflow uses Dapper.
|
|
|
|
|
|
andegre wrote: BY Stackoverflow.
I see that. Interesting. Thanks for the info.
|
|
|
|
|
The difference is big!
If you want faster you have to run your own, like I did.
|
|
|
|
|
Aren't .NET and Mono both from Microsoft, or are you targeting some other platform?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I was just making a comment. I'm not targeting anything.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
The biggest reason I use Dapper, sometimes I just want to create some POCOs and have them access the db. With Dapper all I need is a connection string and my classes..
|
|
|
|
|
Not that one, but I have used something called 'PetaPoco', which is kinda based on Dapper. The nice thing, to me, is it is a single .cs file that can be included right in you solution. He also has a later version that is a normal assembly. You will probably need to google 'PetaPoco' to find it.
|
|
|
|
|
NPoco is the latest version of PetaPoco and is still being actively maintained.
|
|
|
|
|
I've used it a lot. It's excellent, but in large projects its best used with some form of POCO-generator such as Codesmith to auto-generate your DAL classes on your build server.
Dapper is very fast and, even more importantly IMO, it doesn't get in your way.
|
|
|
|
|
I've used Dapper a few times. I really like it and as others have said it generally gets out of the way and works well at mapping your sql to an object or collection of objects.
I use it with Dapper extensions which makes simple selecting/updating etc pretty simple.
I invested a lot of time in learning EF and it was hard to make the move but honestly I've never found a need to go back to using EF. EF seems overly complex, at least for my needs and I fail to see a good reason for using EF over a micro orm like Dapper or PetaPoco (which i also like).
|
|
|
|
|
I use it.
We wrote a slightly bigger ORM thing to go on top of it: Dashing[^]
And yes, much time was spent on the name.
|
|
|
|
|
I've been using Dapper's spinoff NPoco for a couple of years in a large work project and it's worked out mostly great.
The good:
1. Lightning fast, just a fraction slower than bare-bones ADO.NET.
2. No surprise SQL, you know exactly what SQL is sent to the server because you wrote it yourself (unless it's a simple single-table CRUD operation that NPoco generates itself).
3. Latest versions come with Linq expressions support. Back when our project got started there was no Linq support in NPoco and I ended up writing my own Linq-like repository wrapper. (I've made several other customizations to NPoco not all of which have made it into the official codebase, so I can't upgrade.)
The bad:
1. No support for the JOIN syntax in NPoco's Linq implementation. Depending on how you look at it, this can be either a deficiency or a blessing (given how ugly SQL can get with auto-generated joins in EF and other full-feature ORMs).
2. The API can be a little confusing with too many overloaded methods and methods with different names but similar functionality.
|
|
|
|
|
I used it for a project. I didn't use any of the object-relational mapping, but I liked that I could swap this:
SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (rdr.HasRows)
{
while (rdr.Read())
{
}
rdr.Close();
}
with this:
SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
IEnumerable<object> flatResult = conn.Query<dynamic>(sql);
I thought that was pretty handy, especially for quick prototyping where the table and field names were changing a lot and I didn't want to hassle with altering all the field names and just wanted a quick resultset back.
|
|
|
|
|
Inline SQL for anything (C# code files, etc.) is strongly discouraged at our shop, but I see your point.
|
|
|
|
|
If you get a bad tattoo, just what were you inking?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
After a long night of drinking I ended up getting a full body tattoo - it was an exact replica of me, only taller.
|
|
|
|
|
Sounds like a tall order for any tattoo artist.
If I were to get a replica of myself, I would have gone for longer...
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
|
|
|
|
|
Quote: If you get a bad tattoo, just what were you inking? FTFY!
Get me coffee and no one gets hurt!
|
|
|
|
|
If you get an ache in your back, just what were you moving?
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
|
Now, now! The last thing someone with a bad tattoo wants is more needling!
I am not a number. I am a ... no, wait!
|
|
|
|
|
Indeed, that could leave a bad impression.
/ravi
|
|
|
|
|
I could see how one could draw that conclusion.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|