示例#1
0
        public EditManyToManyCommand(SearchTableFromContext <T> request, List <ITableInclude <T> > include, int id)
        {
            this.id      = id;
            this.request = request;

            addCommand = new AddManyToManyCommand <T>(request, include);
        }
示例#2
0
 public ControllerInfo(SearchTableFromContext <T> _request, Action <T> _includeValues, SizeSendViewBag _size, string _views)
 {
     request       = _request;
     includeMethod = _includeValues;
     view          = _views;
     sizeDbFilelds = _size;
 }
示例#3
0
        public IEnumerable <F> DoSelectCommand <F>(SearchTableFromContext <F> selector, bool pagination = false) where F : class
        {
            if (selector == null)
            {
                throw new NullReferenceException();
            }

            SelectCommand <F> select = new SelectCommand <F>(selector, pagination);

            return(SetResultCommand(select));
        }
示例#4
0
        public SelectDefault()
        {
            Book = s =>
                   s.Books.Include("Translators")
                   .Include("Genres")
                   .Include("Languages")
                   .Include("Author");

            Author = s => s.Authors.Include("Books").Include("Genres");

            Publisher = s => s.Publishers.Include("Books");
        }
示例#5
0
 protected ICommandVoid GetCommand(SearchTableFromContext <T> selectorInclude, List <ITableInclude <T> > listAdd, T obj)
 {
     if (type == CommandType.EditCommand)
     {
         return(new EditManyToManyCommand <T>(
                    selectorInclude,
                    listAdd,
                    ReflectionEfId <T> .GetId(obj)
                    ));
     }
     return(new AddManyToManyCommand <T>(selectorInclude, listAdd));
 }
示例#6
0
        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)
                );
        }
示例#7
0
        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)
                );
        }
示例#8
0
 public RelatedTableCommand(IncludeTables <T, A> relMethod, SearchTableFromContext <T> request, List <T> SecondTablesList)
 {
     this.relMethod        = relMethod;
     this.SecondTablesList = SecondTablesList;
     this.request          = request;
 }
示例#9
0
 private JsonResult SetResulst(SearchTableFromContext <T> search, T obj, EntityState entityState)
 {
     voidContext.DoAddCommand(obj, entityState);
     return(Json(selectContext.DoSelectCommand(search)));
 }
示例#10
0
 public SelectCommandAsycn(SearchTableFromContext <T> request, bool isPagination) : base(request, isPagination)
 {
 }
示例#11
0
 public SelectCommandAsycn(SearchTableFromContext <T> request) : base(request)
 {
 }
示例#12
0
 public BaseSelectCommad(SearchTableFromContext <T> request, bool isPagination)
 {
     this.request      = request;
     this.isPagination = isPagination;
 }
示例#13
0
 public BaseSelectCommad(Search <T> request, string search)
 {
     this.request = db => request(db, search);
 }
示例#14
0
 public BaseSelectCommad(SearchTableFromContext <T> request)
 {
     this.request = request;
 }
示例#15
0
 public BaseSelectCommad()
 {
     request = db => db.Set <T>();
 }
示例#16
0
 public AddManyToManyCommand(SearchTableFromContext <T> request, List <ITableInclude <T> > listIncludeCommand)
 {
     this.listIncludeCommand = listIncludeCommand;
     this.request            = request;
 }
示例#17
0
        public IQueryable <F> DoSelectCommandQuery <F>(SearchTableFromContext <F> selector) where F : class
        {
            SelectCommand <F> select = new SelectCommand <F>(selector);

            return(SetResultCommand(select).AsQueryable());
        }
示例#18
0
 public SingleController(SearchTableFromContext <T> request, int id)
 {
     this.id      = id;
     this.request = request;
 }
示例#19
0
        public F DoSingleCommand <F>(SearchTableFromContext <F> selector, int id) where F : class
        {
            SingleController <F> singleCommand = new SingleController <F>(selector, id);

            return(SetResultCommand(singleCommand));
        }