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() + }; + } } }