示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ModelContainer usersContext = new ModelContainer();

            usersContext.Database.CreateIfNotExists();

            usersContext.Users.Add(new User {
                Name = "Vasya"
            });
            usersContext.SaveChanges();
            User user = usersContext.Users.First();

            user.Name = "vasy" + couint;
            usersContext.SaveChanges();
            couint++;
        }