I am using a model-first development approach with Entity Framework, meaning I make schema changes in a designer in Visual Studio, and use the Generate Database from Model command to generate a a SQL script for creating all of the appropriate database
tables which match the model.
I am trying to figure out the best (any) approach to automatically filtering on IsDeleted = false with my various entities. I don't want to have to constantly be adding an IsDeleted = false condition to all of my queries, and lazy loading, etc...
So for example, ideally I would like to be able to write the following code, and know that it is only return entities which are not logically deleted:
var people = context.People;
So I have attempted to implement a few different approaches to no avail:
1.) Within the designer, add a condition to each entity with IsDeleted = 0. The problem with that is that EF only supports having one mapping per property. If I have a condition that refers to
View Complete Post