public static int CalculateTotalCount <T>(this ObjectQuery <T> query, ISearchDataWrapper searchData)
        {
            int         ret = 0;
            ObjectQuery qry = query.Build(EntitySQLQueryWrapper.BuildEntitySQLQueryWrapper(searchData), true);

            if (qry is ObjectQuery <T> )
            {
                ret = ((ObjectQuery <T>)qry).Count();
            }
            else
            {
                ret = ((ObjectQuery <DbDataRecord>)qry).Count();
            }

            return(ret);
        }
 public static ObjectQuery <T> BuildForResult <T>(this ObjectQuery <T> query, ISearchDataWrapper searchData)
 {
     return((ObjectQuery <T>)query.Build(EntitySQLQueryWrapper.BuildEntitySQLQueryWrapper(searchData), false));
 }