public class Entity { public string name { get; set; } public string family { get; set; } public List<sc> score { get; set; } } public class sc { public int Math{ get; set; } public int literature{ get; set; } }
var en = new Entity(); var sc1 = new sc(); var sc2 = new sc(); sc1.Math= 14; sc1.literature= 15; sc2.Math= 16; sc2.literature= 19; en.score[0] = sc1; en.score[1] = sc2; en.name = "Esi"; en.family = "Moja"; collection.Insert(en);
Object reference not set to an instance of an object.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)