private static IEnumerable <ICreative> GetSubsequentCreatives(IDocumentCreativeSource creativeSource, Ad creativeConcept, AdDocumentPayload payload) { if (creativeSource == null) { throw new ArgumentNullException("creativeSource"); } if (payload == null) { throw new ArgumentNullException("payload"); } if (creativeConcept == null) { throw new ArgumentNullException("creativeConcept"); } var adPod = payload.AdPods.FirstOrDefault(ap => ap.Ads.Contains(creativeConcept)); if (adPod != null) { return(adPod.Ads .SelectMany(a => a.Creatives.OrderBy(c => c.Sequence.GetValueOrDefault(int.MaxValue))) .Where(c => !(c is CreativeCompanions)) .SkipWhile(c => c != creativeSource.Creative) .Skip(1)); } return(null); }
private static IEnumerable<ICreative> GetSubsequentCreatives(IDocumentCreativeSource creativeSource, Ad creativeConcept, AdDocumentPayload payload) { if (creativeSource == null) throw new ArgumentNullException("creativeSource"); if (payload == null) throw new ArgumentNullException("payload"); if (creativeConcept == null) throw new ArgumentNullException("creativeConcept"); var adPod = payload.AdPods.FirstOrDefault(ap => ap.Ads.Contains(creativeConcept)); if (adPod != null) { return adPod.Ads .SelectMany(a => a.Creatives.OrderBy(c => c.Sequence.GetValueOrDefault(int.MaxValue))) .Where(c => !(c is CreativeCompanions)) .SkipWhile(c => c != creativeSource.Creative) .Skip(1); } return null; }