I need to loop through a list of type TrackRecordVM and extract data from fields that are only assigned to fields names Jan, Feb, Mar,Apr, May, Jun, July,Aug,Sep,Oct,Nov,Dec
This is the list that I am looping through
public class TrackRecordVM
{
public int Year { get; set; }
public decimal? Jan { get; set; }
public decimal? Feb { get; set; }
public decimal? Mar { get; set; }
public decimal? Apr { get; set; }
public decimal? May { get; set; }
public decimal? Jun { get; set; }
public decimal? Jul { get; set; }
public decimal? Aug { get; set; }
public decimal? Sep { get; set; }
public decimal? Oct { get; set; }
public decimal? Nov { get; set; }
public decimal? Dec { get; set; }
public decimal? YTD { get; set; }
public decimal? Bmrk { get; set; }
public string BmrkName { get; set; }
}
Here is the loop. Whats the best way of doing it
List<TrackRecordVM> trackRecordVm;
foreach (var trackRecord in fundTrackRecord)
{
trackRecordVm = trackRecord.TrackRecord;
foreach (var track in trackRecordVm)
{
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…