public IPagedList <CountryExt> GetPagedList(CountryParam param) { var ctx = this.UnitOfWork as LMS_DbContext; if (ctx == null) { return(null); } return((from a in ctx.Countries .WhereIf(p => p.Name.StartsWith(param.Name), !param.Name.IsNullOrEmpty()) .WhereIf(p => p.ChineseName.StartsWith(param.ChineseName), !param.ChineseName.IsNullOrEmpty()) .WhereIf(p => p.CountryCode.StartsWith(param.CountryCode), !param.CountryCode.IsNullOrEmpty()) select new CountryExt() { ChineseName = a.ChineseName, CountryCode = a.CountryCode, Name = a.Name } ).OrderBy(p => p.CountryCode).ToPagedList(param.Page, param.PageSize)); }
public IPagedList <CountryExt> GetPagedList(CountryParam param = null) { param = param ?? new CountryParam(); return(_countryRepository.GetPagedList(param)); }