C# - Adding data to list inside list

前端 未结 5 826
耶瑟儿~
耶瑟儿~ 2021-01-14 00:40

How can I add the following data on the table into a list called Vehicles?

public class criterias
{
    public double values { get; set; }
    publi         


        
5条回答
  •  清歌不尽
    2021-01-14 01:01

    You should create your classes like the following:

    public class criterias
    {
        public double values { get; set; }
        public double time { get; set; }
    }
    
    public class movChannels
    {
        public movChannels
        {
            criteria = new List();
        }
        public string name { get; set; }
        public IList criteria { get; set; }
    }
    
    public class stepsList
    {
        public stepsList
        {
            stepChannelsCriteria = new List();
        }
        public string steps { get; set; }
        public IList stepChannelsCriteria { get; set; }
    }
    
    public class vehicles
    {
        public vehicles
        {
            vehValCriteria = new List();
        }
        public int vehID { get; set; }
        public string vehDescription { get; set; }
        public IList vehValCriteria { get; set; }
        public movChannels movments { get; set; }
    }
    

提交回复
热议问题