using TIAM.Database.DbContexts.ServiceProviders; using TIAM.Entities.Users; namespace TIAM.Database.DbSets.Users; public static class UserProductMappingDbSetExtensions { public static UserProductMapping? GetUserProductMappingById(this IAssignedUserDbSet ctx, Guid userProductMappingId) => ctx.UserProductMappings.FirstOrDefault(x => x.Id == userProductMappingId); public static IQueryable GetUserProductMappingsByProductId(this IAssignedUserDbSet ctx, Guid productId) => ctx.UserProductMappings.Where(x => x.ProductId == productId); }