ActivEarth.DAO.GroupDAO.GetAllGroupsByHashTag C# (CSharp) Метод

GetAllGroupsByHashTag() публичный статический Метод

Retrieves all currently created Groups that are tagged with the given hashtag.
public static GetAllGroupsByHashTag ( string hashtag ) : List
hashtag string A desired string tag
Результат List
        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;
            }
        }