/// <summary> /// Executes the Current QueryBuilder by setting the type /// </summary> /// <param name="page">The page.</param> /// <param name="pageSize">Size of the page.</param> /// <returns></returns> public IDataPager <TPoco> ForPagedResult(int page, int pageSize) { var command = ContainerObject.Compile(); var pager = ContainerObject.AccessLayer.Database.CreatePager <TPoco>(); if (pager is MsSqlUntypedDataPager <TPoco> ) { var msPager = pager as MsSqlUntypedDataPager <TPoco>; msPager.CommandQuery = this; } else { pager.BaseQuery = command; } pager.PageSize = pageSize; pager.CurrentPage = page; pager.LoadPage(ContainerObject.AccessLayer); return(pager); }