Пример #1
0
        //adding method
        private void Test3()
        {
            Genre Genre = new Genre()
            {
                Name = txtAddGenre.Text,
            };

            _context.Genres.Add(Genre);
            _context.SaveChanges();
        }
Пример #2
0
        private void Test1()
        {
            Author Author = new Author()
            {
                Name    = txtAuthorName.Text,
                Surname = txtAuthorSurname.Text
            };

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

            _context.Customers.Add(customer);
            _context.SaveChanges();
        }
Пример #4
0
 public void Commit()
 {
     _context.SaveChanges();
 }