public static List<Group> GetAllGroupsByHashTag(string hashtag)
{
List<Group> taggedGroups = new List<Group>();
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
List<int> groupIds = (from h in data.GroupHashtagDataProviders
where h.hashtag.ToLower().Contains(hashtag.ToLower())
select h.group_id
).ToList();
foreach (int groupId in groupIds) {
Group group = GetGroupFromGroupId(groupId);
taggedGroups.Add(group);
}
return taggedGroups;
}
}