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)); }
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); } }
public void RemoveList(T obj) { listSecondTables.Remove(listSecondTables.FirstOrDefault(s => ReflectionEfId <T> .GetId(s) == ReflectionEfId <T> .GetId(obj))); }
public void SetCommand(BookContext db) { T firstIdEqual = request(db).AsEnumerable().FirstOrDefault(j => ReflectionEfId <T> .GetId(j) == id); addCommand.SetEdit(firstIdEqual, db); }
public T SetCommand(BookContext db) { return(request(db).AsEnumerable().FirstOrDefault(k => ReflectionEfId <T> .GetId(k) == id)); }
private bool HasEqualsId(A second1, A second2) { return(ReflectionEfId <A> .GetId(second1) == ReflectionEfId <A> .GetId(second2)); }