ログインしているクライアントの辞書を維持しています_clientList.Add(clientIDGuid, newsfeedClient);
NewsfeedClient クラス:
public class NewsfeedClient
{
/// <summary>
/// Represents Newsfeed's own clientID
/// </summary>
public string ClientIDGuid { get; set; } // also adding the dictionary's ID
/// <summary>
/// Represents the logged in client's session ID
/// </summary>
public string SessionID { get; set; }
public string Nickname { get; set; }
public int ProfileID { get; set; }
public GeoLocation Location { get; set; }
public List<MyDB.Models.Buddy> BuddyList { get; set; }
[ScriptIgnore]
public DateTime LastResponseTime { get; set; }
public class GeoLocation
{
public float Latitude { get; set; }
public float Longitude { get; set; }
}
}
Buddy
オブジェクトにはプロパティが含まれていますProfileID
。
一致する profileID がその新しいクライアントの BuddyList にあるすべての辞書 clientID のリストを取得したいと考えています。
hereに見られるように Intersect メソッドが機能すると推測していますが、少なくとも 1 つのforeach
ループを作成せずにこれをまとめる方法がよくわかりません。
- アップデート -
clientID は == ProfileID ではありません。これらの値は異なります。