public BindingList <Authors> Reset() { booksAuthorsContext.Dispose(); booksAuthorsContext = new BooksAuthorsContext(); booksAuthorsContext.Authors.Include("Books").Load(); return(booksAuthorsContext.Authors.Local.ToBindingList()); }
public BooksAuthorsPersistentContext() { if (booksAuthorsContext == null) { booksAuthorsContext = new BooksAuthorsContext(); try { booksAuthorsContext.Authors.Include("Books").Load(); booksAuthorsContext.PublishingHouses.Include("Books").Load(); booksAuthorsContext.Books.Load(); } catch { throw; } } }