From acd766921341789c800781a19947140828874772 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Fri, 22 Feb 2019 12:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9AMongoDB=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E7=A8=8B=E5=BA=8F=E5=BC=82=E5=B8=B8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=8D=E5=8F=AF=E7=94=A8=20#IRWN5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess.MongoDB/Exceptions.cs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Bootstrap.DataAccess.MongoDB/Exceptions.cs b/Bootstrap.DataAccess.MongoDB/Exceptions.cs index b126b2be..c0e54c5a 100644 --- a/Bootstrap.DataAccess.MongoDB/Exceptions.cs +++ b/Bootstrap.DataAccess.MongoDB/Exceptions.cs @@ -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; } + + /// + /// + /// + /// + /// + /// + /// + public override Page RetrievePages(PaginationOption po, DateTime? startTime, DateTime? endTime) + { + var exceps = DbManager.Exceptions.Find(FilterDefinition.Empty).ToList(); + return new Page() + { + 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() + }; + } } }