> >Func(ITariffDataImport, string) grp = null; > > if (App.ImportSettings.RemoveDuplicates) > { > Console.WriteLine("Removing duplicate tariffs..."); > > if (App.tariffType == TariffType.BTInternational) > grp = s => s.Destination; > else > if (App.tariffType == TariffType.BTNational118) > grp = s => s.ChargeBand; > else > if (App.tariffType == TariffType.BTNationalIP) > grp = s => s.Service; > > xlistint.Data = xlistint.Data.GroupBy(grp).Select(s => s.First()).ToList(); >>
switch (App.tarriffType) { case TarriffType.BTInternational: grp = s => s.Destination; break; case TarriffType.BTNational118: grp = s => s.ChargeBand; break; case TarriffType.BTNationalIP: grp = s => s.Service; break; }BTW I think that although UT shows an error with the angle brackets on preview it actually works when you send .....