public async Task <JsonResult> GetDataList(PhotoManagerCondition condition) { string ip = this.Request.Host.ToUriComponent(); //获取所有的图片 string dir = this.Request.Scheme + "://" + ip + "/"; var data = await _photo.GetDataList(condition); foreach (var item in data.Data) { item.Url = dir + item.Url; } return(AjaxHelper.Seed(Ajax.Ok, data)); }
public async Task <ListResult <PhotoManager> > GetDataList(PhotoManagerCondition condition) { Tuple <int, List <PhotoManager> > data = null; if (condition.IsPage) { data = await this.GetPageAsync(p => p.Id > 0, p => p.CreateTime, condition.PageIndex, condition.PageSize); } else { List <PhotoManager> managers = await this.GetAllAsync(); data = new Tuple <int, List <PhotoManager> >(managers.Count, managers); } return(new ListResult <PhotoManager>(condition.PageIndex, condition.PageSize, data.Item1, data.Item2)); }