When to use EF queries, LinQ, or MySQLClient
Attached is one of the Entity Framework (EF) queries I'm referring to (I'm not sure if this is what it's actually called).
Assuming you're building an app from scratch, in which contexts does each one perform best/worst?
I'm really confused because it seems that you can do basically everything by opening connections and passing SQL queries with MySQLClient, so there must be some advantages to EF or LinQ
10 Replies
I'm told that EF comes with migrations and additional features that make it more appealing to db management, what other advantages does it have when it comes to DB management?
Not requiring you to write SQL
Also, during runtime does EF+LINQ run any slower/faster than manual DB management+MySQLClient?
The difference is marginal to none
laughs in horribly generated ef sql code
By EF drivers, do you mean these?
https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli
Database Providers - EF Core
Information about specific supported Entity Framework Core providers and about providers in general
So you are saying that these will automatically allow me to swap freely between MySQL, MsSQL, PostGres and MariaDB?
Yep
Well, mostly. Sure, just swapping the driver will do the job most of the time, but if you're using for example array columns (Postgres) switching to MariaDB won't be easy since it doesn't support this feature
That's crazy
I feel like a neanderthal for manually doing MySQL DB scripts