public bool Delete(int id) { var entity = EntityTable.FirstOrDefault(LinqExpression(id)); if (entity != null) { EntityTable.Remove(entity); SaveDb(); return(true); } else { return(false); } }
public TEntity GetById(int id) { TEntity entity = EntityTable.FirstOrDefault(LinqExpression(id)); return(entity); }
public TEntity GetByExpression(Func <TEntity, bool> expression) { TEntity entity = EntityTable.FirstOrDefault(expression); return(entity); }