MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

Data Access Technology #607

Open GreggThelen opened 6 years ago

GreggThelen commented 6 years ago

Greetings:

For the past 15 years or so all of my business objects have held the Data Access Layer, that is, direct database access in the CRUD methods defined in the business base classes. This has worked out really well and I've no complaints.

Now I'm starting my first ASP.NET Core project which means I'm learning all sorts of new fun things and I'm wondering if it would be a good time to break out my project such that I've a User Interface project, a Model (or Library) project and a DataAccess project.

I see that in the Razor example for the latest release of CSLA that Rocky used Dapper. I read up a bit on Dapper and the Entity Framework - wow, are these things unusual.

Assuming a ASP.NET Core environment can I get some discussion/pros/cons (or a rundown of your experiences) on choosing between EFCore, Dapper, and the traditional data access approach?

Thanks in Advance, Gregg

ajj7060 commented 6 years ago

Personally Id go with EF; direct Ado.Net is not as easy to work with, for example finding everywhere a certain column is used. You're left hunting through strings. With EF, you basically have a type definition of your database tables. I have no experience with dapper.

rockfordlhotka commented 6 years ago

EF Core is nice and fast. So is Dapper. I tend to a avoid classic EF, and find that Dapper is the perfect lightweight abstraction over ADO. NET.

tfreitasleal commented 6 years ago

Hi Gregg,

As stated in a thread about code generation tools,

As CslaGenFork does most if not all of my SQL coding for me, I don't see there is any advantage on using anything other than ADO.NET. For me ADO.NET is simpler than EF or Dapper, or whatever, because I don't see SQL code at all, except when I have to do some super-extra complicated query that would have to be hand coded on any techonology.

Furthermore, every other database techonology is build on top of ADO.NET. So it won't be faster than ADO.NET for sure.

Chicagoan2016 commented 6 years ago

Hi All, as soon as I went to Dapper's website there is "Improve Dapper performance by 2000%" and license for Dapper Plus is $599 per developer which is not bad but is it worth paying for it when EF Core is free?

Regards

ajj7060 commented 6 years ago

@Chicagoan2016 I'm pretty sure Dapper is free.

https://stackexchange.github.io/Dapper/

Chicagoan2016 commented 6 years ago

@ajj7060 , I was referring to this http://dapper-tutorial.net/dapper

is this a different dapper?

ajj7060 commented 6 years ago

I don't think that's the official one; Dapper is done by StackExchange, and its OSS on GitHub.

It looks like that page is by a company which sells something on top of Dapper that is supposed to improve its performance (although my understanding is that its's already very fast).

Chicagoan2016 commented 6 years ago

that's good news, thanks @ajj7060 for helping CSLA community for years (or as far as I could recall).

Regards

Chicagoan2016 commented 6 years ago

If @rockfordlhotka likes Dapper, for me that's the seal of awesomeness : ) for Dapper.