C# 返回元组字典作为c中函数的返回类型#

C# 返回元组字典作为c中函数的返回类型#,c#,dictionary,group-by,tuples,C#,Dictionary,Group By,Tuples,我有一本字典如下: var returnedresult = (from v in vaults.Where(v => v.IntegrationTypeInternal == (int)integrationType) join c in DB.Cobrands on v.Cobrand.ID equals c.ID join p in DB.Tax

我有一本字典如下:

  var returnedresult = (from v in vaults.Where(v => v.IntegrationTypeInternal == (int)integrationType)
                                  join c in DB.Cobrands on v.Cobrand.ID equals c.ID
                                  join p in DB.TaxPartners on c.ID equals p.Cobrand.ID
                                  join pb in DB.TaxPartnerBranches on p.ID equals pb.Partner.ID
                                  join pa in DB.TaxPartnerAgents on pb.ID equals pa.Branch.ID
                                  join pac in DB.Accounts on pa.Account.ID equals pac.ID
                                  where v.Account == null || v.Account.ID == pac.ID
                                  select new
                                  {
                                      v.Account,
                                      v.Cobrand,
                                      v.CredentialsXml,
                                      pac
                                  }).ToList();


var myDictionary2 = returnedresult.GroupBy(x => new { x.Account, x.Cobrand, x.CredentialsXml },
            (key, group) => new
            {
                key1 = key.Account,
                key2 = key.Cobrand,
                key3 = key.CredentialsXml,
                result = group.Select(g => g.pac).ToList()
            });

是否可以使用元组来代替此字典键?我想在函数中返回此字典,我不知道如何在不为字典键创建新类型作为对象的情况下返回它

var myDictionary2 = returnedresult.GroupBy(x => new { x.Account, x.Cobrand, x.CredentialsXml },
        (key, group) => Tuple.Create(key.Account, key.Cobrand, key.CredentialsXml, group.Select(g => g.pac).ToList());