Entity Framework for Multi-tenant architecture - filterings single table by tenant ID
We are looking for a way of automatically filtering all CRUD operations by a tenant ID in Entity Framework. The ideas we thought of were: Using table valued user defined functions Using stored procedures (but we don't really want to, as we're using an ORM to avoid doing so) Some how modifying the templates used to generate the SQL to add a where clause on each statement. Some how modifying the templates used to generate the LINQ in the controllers (we may use MVC). Any tips? -thanks Alex. Using table valued user defined functions Table valued function are only available in .NET 4.5 Beta (and