組織オブジェクトがあります
public class Organisation
{
OrgId {get....}
OrgName {get...}
AccountTypes { get....} //this is of type List<AccountType>
}
および AccountType オブジェクト
public class AccountType
{
AccountTypeId {get....}
AccountTypeName {get...}
}
既存の組織リストを調べて、別の AccountTypes リストにアカウント タイプが見つからない各組織から AccountTypes を削除する方法を探しています (これはブラウザーからのポスト バックになります)。
私は何かをしますか?
var foundOrgs = from org in orgs
where org.OrganisationId == Convert.ToInt32(hash["orgId"])
select org;
Organisation organisation = foundOrgs.ElementAt(0);
organisation.AccountTypes.Clear();
organisation.AccountTypes = // What goes here?
あるリストを別のリストと比較し、AccountTypeIDs が一致する、または存在するアイテムのみを返す Linq クエリを実行しようとしています。