Created
October 16, 2018 14:43
-
-
Save Dviejopomata/f72c739ccd70a21d8a6dff2786acc114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DbExtensions | |
{ | |
public static IQueryable<T> FilterByTenant<T>(this IQueryable<T> baseEntities, string | |
tenantId) where T : BaseEntity | |
{ | |
return baseEntities.Where(r => r.TenantId == tenantId); | |
} | |
public static IQueryable<T> FilterByTenantName<T>(this IQueryable<T> baseEntities, string | |
tenantId) where T : BaseEntity | |
{ | |
return baseEntities.Where(r => r.Tenant.Name == tenantId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment