コード例 #1
0
        private void buttonBEkleme_Click(object sender, EventArgs e)
        {
            Branch branch = new Branch
            {
                Name = textBoxBEkleme.Text
            };

            EfContext efContext = new EfContext();

            efContext.Branches.Add(branch);

            try
            {
                efContext.SaveChanges();
                MessageBox.Show("Kaydedildi");
            }
            catch (Exception exception)
            {
                MessageBox.Show("Kaydedilmedi");
            }

            efContext.Dispose();
        }