private void buttonload_Click(object sender, EventArgs e) { Human zhansan = new Human(); zhansan.Age = 19; HumanCurdRepository database = new HumanCurdRepository(); database.Add(zhansan); this.dataGridView.DataSource = database.GetAll(); }
static void Main(string[] args) { //Human zhansan = new Human(); //zhansan.Age = 18; //Human lisi = new Human(); //lisi.Age = 19; //Human wangwu = new Human(); //Human zhaoliu = new Human(); Human zhansan = new Human(); zhansan.Age = 19; HumanCurdRepository database = new HumanCurdRepository(); database.Add(zhansan); Console.WriteLine(JsonConvert.SerializeObject(database.GetAll())); }