public IList <T> FindAll <T>(int startPage, int pageSize) where T : class { dynamic retObj = Activator.CreateInstance <T>(); var query = CurrentRepository.FindAll <T>(GenerateSelectQuery(retObj, null)); return(query.Skip((startPage - 1) * pageSize).Take(pageSize).ToList()); }
/// <summary> /// Explicit Casting And ToList was required for ReferenceController to resolve var /// findMethod = ReferenceDataManager.GetType().GetMethod("FindAll").MakeGenericMethod(type); /// </summary> /// <typeparam name="T"></typeparam> /// <param name="parameters"></param> /// <param name="startPage"></param> /// <param name="pageSize"></param> /// <returns></returns> public IList <T> FindAll <T>(IList <TableQueryParameters> parameters = null, int startPage = 0, int pageSize = 0) where T : class { dynamic retObj = Activator.CreateInstance <T>(); List <T> query = CurrentRepository.FindAll <T>(GenerateSelectQuery(retObj, parameters)); if (query.Count != 0 && pageSize != 0 && startPage != 0) { return(query.Skip((startPage - 1) * pageSize).Take(pageSize).ToList()); } return(query); }
public IList <T> FindAll <T>(IList <TableQueryParameters> parameters) where T : class { dynamic retObj = Activator.CreateInstance <T>(); return(CurrentRepository.FindAll <T>(GenerateSelectQuery(retObj, parameters))); }