ASP.NET Core 2.2 and Entity Framework Core development

Soldato
Joined
1 Nov 2007
Posts
6,236
Location
England
I'm about to start creating a website using .NET Core 2.2 and ASP.NET Core 2.2. I'll be using PostgreSQL 11.3 as the database, but I'm trying to decide whether I should use Entity Framework Core or whether I should use raw SQL.

The advantage of Entity Framework Core is that everything stays in C# which makes management more manageable but the benefit of using raw SQL is that I can do everything via stored procedures and triggers as well as doing decent profiling so I can optimise the SQL queries aggressively.

At the moment I'm not sure which route to take. Does anyone have any advice at all?
 
What is the aim of the website and how busy is it going to be?

For me, I'd be going raw sql but that's because I use tsql day in and day out at work :)

I'm just starting out with c#, done a few console apps checking for files etc for work but i'd like to look at website dev really. So much info though. VS2017 pro at work, community edition on home laptop of vs2019. .NET versions, SDKs etc... mind blowing
 
I'd also go for raw SQL, but that's mostly because I'm used to working with teams which contain Database analysts who can work with the SPs separate from the main C# code base. It also makes it easier to tweak performance without needing to update any running systems. The final benefit, IMO, is that it completely avoids EF, which is a big plus :)
 
As above, depends what your website is for. If it's CRUD and fairly standard DB structures, EF is ok. I'd be leaning towards Dapper and SQL queries for anything moderately complicated though.
 
What is the aim of the website and how busy is it going to be?

As above, depends what your website is for. If it's CRUD and fairly standard DB structures, EF is ok. I'd be leaning towards Dapper and SQL queries for anything moderately complicated though.

The website is going to be a social network for politics. I imagine it will be fairly small but I want to try and make it grow to a reasonable size.

Thank you all for the replies I think I'll go with raw SQL as you have all said.
 
Back
Top Bottom