修改BUG:MongoDB模式下程序异常页面不可用 #IRWN5

This commit is contained in:
Argo-Surface 2019-02-22 12:19:15 +08:00
parent 707f3b8516
commit acd7669213
1 changed files with 25 additions and 1 deletions

View File

@ -1,7 +1,10 @@
using MongoDB.Driver;
using Longbow.Web.Mvc;
using MongoDB.Driver;
using PetaPoco;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
namespace Bootstrap.DataAccess.MongoDB
{
@ -51,5 +54,26 @@ namespace Bootstrap.DataAccess.MongoDB
ClearExceptions();
return true;
}
/// <summary>
///
/// </summary>
/// <param name="po"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public override Page<DataAccess.Exceptions> RetrievePages(PaginationOption po, DateTime? startTime, DateTime? endTime)
{
var exceps = DbManager.Exceptions.Find(FilterDefinition<DataAccess.Exceptions>.Empty).ToList();
return new Page<DataAccess.Exceptions>()
{
Context = exceps,
CurrentPage = po.PageIndex,
ItemsPerPage = po.Limit,
TotalItems = exceps.Count,
TotalPages = (long)Math.Ceiling(exceps.Count * 1.0 / po.Limit),
Items = exceps.Skip(po.Offset).Take(po.Limit).ToList()
};
}
}
}