Exemple #1
0
        //adding method
        private void Test3()
        {
            Genre Genre = new Genre()
            {
                Name = txtAddGenre.Text,
            };

            _context.Genres.Add(Genre);
            _context.SaveChanges();
        }
        private void Test1()
        {
            Author Author = new Author()
            {
                Name    = txtAuthorName.Text,
                Surname = txtAuthorSurname.Text
            };

            _context.Authors.Add(Author);
            _context.SaveChanges();
        }
Exemple #3
0
        private void Test4()
        {
            Customer customer = new Customer()
            {
                Name    = txtcCustomerName.Text,
                Surname = txtcCustomerSurname.Text,
                Email   = txtcCustomEmail.Text
            };

            _context.Customers.Add(customer);
            _context.SaveChanges();
        }
 public void Commit()
 {
     _context.SaveChanges();
 }