public static List <ManagedSystem> GetManagedSystemsForTermWithGroupPermissionsForGroup(this DbSet <ManagedSystem> systems, ManagedSystemGroup managedSystemGroup, string term, int limit = 15) { return(systems.Where(x => x.Name.Contains(term) || x.Hostname.Contains(term)) .Include(x => x.ManagedSystemManagedSystemGroups.Where(y => y.ManagedSystemGroup.Id == managedSystemGroup.Id)) .OrderBy(x => x.Name) .Take(limit) .ToList()); }
public static List <ManagedSystem> GetManagedSystemsWithGroupPermissionsForGroup(this DbSet <ManagedSystem> systems, ManagedSystemGroup managedSystemGroup) { return(systems .Include(x => x.ManagedSystemManagedSystemGroups.Where(y => y.ManagedSystemGroup.Id == managedSystemGroup.Id)) .Where(x => x.ManagedSystemGroups.Contains(managedSystemGroup)) .ToList()); }