public static List<Group> GetAllGroupsByName(string partialName)
{
List<Group> namedGroups = new List<Group>();
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
List<int> groupIds = (from g in data.GroupDataProviders
where g.name.ToLower().Contains(partialName.ToLower())
select g.id
).ToList();
foreach (int groupId in groupIds)
{
Group group = GetGroupFromGroupId(groupId);
namedGroups.Add(group);
}
return namedGroups;
}
}