-1
if (model.ConnectedToOtherProfilesId != 0)
{
      var fooGroup = fans.GroupBy(x => x.FanId)
                         .Where(x => x.Any(z => z.ProfileId == model.ConnectedToOtherProfilesId));

      var fooGroup2 = fooGroup.Where(grp => grp.Count() > 1);
}

What I need is to put the results from fooGroup2 [IQueryable<IGrouping<int,PF>] into fans which is IQueryiable<PF>

Something like this:

fans = fooGroup2;
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
nightowl
  • 309
  • 1
  • 3
  • 13

1 Answers1

1

You could use a SelectMany.

//IQueryable<PF>
var fooGroup2 = fooGroup.Where(grp => grp.Count() > 1)
                        .SelectMany(pf => pf);
Stefan
  • 17,448
  • 11
  • 60
  • 79