public sealed override void SetCommand(Author author) { FileController.Obj = author; contextVoid.SetVoidCommand(FileController); RelatedTableCommand <Author, Genre> relTableGenre = new RelatedTableCommand <Author, Genre>( authorType => authorType.Genres, bookDb => bookDb.Genres, ListCollection.genres ); SearchTableFromContext <Author> AuthorContext = s => s.Authors.Include("Genres"); List <ITableInclude <Author> > listManyAuthor = new List <ITableInclude <Author> > { relTableGenre }; contextVoid.SetVoidCommand( GetCommand(AuthorContext, listManyAuthor, author) ); }
public sealed override void SetCommand(Book book) { FileController.Obj = book; contextVoid.SetVoidCommand(FileController); RelatedTableCommand <Book, Genre> relTableGenre = new RelatedTableCommand <Book, Genre>( bookType => bookType.Genres, bookDb => bookDb.Genres, ListCollection.genres ); RelatedTableCommand <Book, Language> relTableLanguage = new RelatedTableCommand <Book, Language>( bookType => bookType.Languages, bookDb => bookDb.Languages, ListCollection.languages ); RelatedTableCommand <Book, Translator> relTableTranslator = new RelatedTableCommand <Book, Translator>( bookType => bookType.Translators, bookDb => bookDb.Translators, ListCollection.translators ); List <ITableInclude <Book> > listManyBook = new List <ITableInclude <Book> >() { relTableGenre, relTableLanguage, relTableTranslator }; SearchTableFromContext <Book> bookContext = s => s.Books .Include("Genres") .Include("Languages") .Include("Translators"); contextVoid.SetVoidCommand( GetCommand(bookContext, listManyBook, book) ); }