Entity Framework Core Remove method sometimes leads to an antipattern

A very simple way to delete entities in EF Core without preliminarily getting that entity. If we know its primary key, there is no need to do a get request, we just have to inform EF that the object is supposed to exist and deal with the case where it doesn’t exist. It’s obvious but very little used

More Efficient Deletes With Entity Framework Core | Khalid Abuhakmeh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s