Data Layer for RestAPI

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
28,050
Reaction score
17,804
What do you guys use or rather, what is commonly used? Entity Framework?

I was using the ADO.NET Entity Data Model but am staring to experiment a bit and implemented my own data layer using Dapper with naming conventions like AuthorsContext, BooksContext etc. What do you guys recommend?

For testing I'm using Swagger and SoapUI. So far so good.
 
I think there's no one size fits all, it depends on your project. I have been using Dapper for the past couple of years on applications I develop, I like the flexibility and the fact Dapper's performance is closer to executing SQL queries directly.
 
I have not done .NET for a few years, but my preference would be Dapper over EF: it is lighter, faster and more flexible.

A heavier, less flexible and less pleasant framework exists: NHibernate. "Fluent" NHibernate is better, but avoid this framework like the plague.

Edit: SoapUI sucks dog cocks. It is really badly written software. It has some features that other software does not, but I prefer Postman (I'm using the Mac version, not sure if the Windows version is comparable). Just the fact the SoapUI "devs" (clearly the bottom end of the O/S community) failed to understand how to focus windows is enough of an irritation that makes it a terrible user experience.

And further edit: Unrelated, but if you are doing .NET dev there will come a time when you need to send emails (notifications, queries, whatever). At that time you will thank me for recommending PaperCut - https://github.com/ChangemakerStudios/Papercut - a locally hosted SMTP solution. It is simple but incredibly useful.
 
Last edited:
We also use dapper. Bit more work than Entity as you have to override a few methods of the .net framework but once in place , you won't look back.

Used Entity versions 3,4 and 5, not a fan. Used NHibernate for many years ( still kicking around in a few projects ) , works well but much heavier than dapper as it is a full ORM.

Postman>SoapUI. I tend to use both though, postman for modern and SoapUI for older SOAP services as that is the tool used by our third party so it's just easier to send them the "projects" when bugs occur and they can replicate the issue.
 
Top
Sign up to the MyBroadband newsletter
X