/// <summary> /// Get members attributed with a certain IdAttribute with a specific ID. /// </summary> /// <typeparam name = "TAttributeType">The type of IdAttribute to look for.</typeparam> /// <param name = "id">The id the IdAttribute should have.</param> /// <returns>All matching IdAttributes for every member where matches were found.</returns> protected Dictionary <MemberInfo, TAttributeType[]> GetAttributedMembers <TAttributeType>(TEnum id) where TAttributeType : IdAttribute { return(( from member in OwnerType.GetMembers(ReflectionHelper.FlattenedClassMembers) from attribute in member.GetAttributes <TAttributeType>() where attribute.GetId().Equals(id) group attribute by member ).ToDictionary(g => g.Key, g => g.ToArray())); }