/// <summary> /// 创建 URL 的实现代码 /// </summary> /// <param name="urlBuilder"></param> /// <param name="filters">IEnumerable<IFilterPart></param> /// <param name="sorts">IEnumerable<ISortPart></param> /// <param name="pageIndex"></param> /// <returns></returns> private string BuildUrl(IUrlBuilder urlBuilder, IEnumerable<IFilterPart> filters, IEnumerable<ISortPart> sorts, int pageIndex) { urlBuilder.Initialize(this.ContentType); urlBuilder.BeginFilter(); foreach (IFilterPart part in filters) { part.BuildUrl(urlBuilder); } urlBuilder.EndFilter(); urlBuilder.BeginSort(); foreach (ISortPart part in sorts) { part.BuildUrl(urlBuilder); } urlBuilder.EndSort(); urlBuilder.SetPageSize(this.PageSize); return urlBuilder.GetUrl(pageIndex); }