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));
 }
Exemple #2
0
        public void SetCommand(A mainTable, BookContext db)
        {
            relMethod(mainTable).Clear();

            foreach (T secondTable in SecondTablesList)
            {
                T equalsId = request(db).AsEnumerable().FirstOrDefault(
                    k => ReflectionEfId <T> .GetId(k) == ReflectionEfId <T> .GetId(secondTable)
                    );

                relMethod(mainTable).Add(equalsId);
            }
        }
Exemple #3
0
 public void RemoveList(T obj)
 {
     listSecondTables.Remove(listSecondTables.FirstOrDefault(s => ReflectionEfId <T> .GetId(s) == ReflectionEfId <T> .GetId(obj)));
 }
Exemple #4
0
        public void SetCommand(BookContext db)
        {
            T firstIdEqual = request(db).AsEnumerable().FirstOrDefault(j => ReflectionEfId <T> .GetId(j) == id);

            addCommand.SetEdit(firstIdEqual, db);
        }
Exemple #5
0
 public T SetCommand(BookContext db)
 {
     return(request(db).AsEnumerable().FirstOrDefault(k => ReflectionEfId <T> .GetId(k) == id));
 }
Exemple #6
0
 private bool HasEqualsId(A second1, A second2)
 {
     return(ReflectionEfId <A> .GetId(second1) == ReflectionEfId <A> .GetId(second2));
 }