Exemple #1
0
        private static void AddAuthorsToBook(int bookID, List <Author> bookAuthors)
        {
            using (BookDBDataContext context = new BookDBDataContext())
            {
                foreach (var author in bookAuthors)
                {
                    var bookAuthor = new BookAuthor()
                    {
                        BookID   = bookID,
                        AuthorID = author.ID
                    };
                    context.BookAuthors.InsertOnSubmit(bookAuthor);
                }

                context.SubmitChanges();
            }
        }
Exemple #2
0
        private static void AddAuthorsToBook(int bookID, List<Author> bookAuthors)
        {
            using (BookDBDataContext context = new BookDBDataContext())
            {
                foreach (var author in bookAuthors)
                {
                    var bookAuthor = new BookAuthor()
                    {
                        BookID = bookID,
                        AuthorID = author.ID
                    };
                    context.BookAuthors.InsertOnSubmit(bookAuthor);
                }

                context.SubmitChanges();
            }
        }
Exemple #3
0
 partial void DeleteBookAuthor(BookAuthor instance);
Exemple #4
0
 partial void UpdateBookAuthor(BookAuthor instance);
Exemple #5
0
 partial void InsertBookAuthor(BookAuthor instance);
Exemple #6
0
		private void detach_BookAuthors(BookAuthor entity)
		{
			this.SendPropertyChanging();
			entity.Author = null;
		}
Exemple #7
0
		private void attach_BookAuthors(BookAuthor entity)
		{
			this.SendPropertyChanging();
			entity.Author = this;
		}