public void Transform() { var records = new List<Vin12Record>(); _carInformation.ForEach(s => { Enumerable.Range(s.IntroductionYear, s.YearCounter) .ToList() .ForEach(year => records.Add(new Vin12Record(s.CarId, year, s.CarFullName, s.ImageUrl, s.BodyShape, ""))); }); Result = new Vin12Response(records); Result.AddResponseState(Result.Vin12Information.Any() ? DataProviderResponseState.VinShort : DataProviderResponseState.NoRecords); }
public TransformVin12Response(List<Vin12CarinformationDto> carInformation) { Continue = carInformation != null && carInformation.Any(); Result = Continue ? null : Vin12Response.Empty(); _carInformation = carInformation; }