Add new item to List object C#

后端 未结 4 1384
灰色年华
灰色年华 2021-01-16 09:33

I want to add new object to a list: My code:

List abc = new List();
abc.Add(new geo_tag() { latitude = 111, longitude = 122, un         


        
4条回答
  •  一生所求
    2021-01-16 10:06

    Creating new object of Geo and feeding the data at the time of initialization

      List geo = new List {
                        new Geo { Latitude=111,Longitude=222,Unit="jjj"},
                        new Geo { Latitude = 112, Longitude = 223, Unit = "nnn" },
                        new Geo { Latitude = 113, Longitude = 224, Unit = "kkk" }
                    };
    

提交回复
热议问题