/// <summary> /// /// </summary> /// <returns></returns> public QueryData <object> Retrieves() { var data = ExceptionsHelper.RetrievePages(this, StartTime, EndTime); var ret = new QueryData <object>(); ret.total = (int)data.TotalItems; ret.rows = data.Items.Select(ex => new { ex.UserId, ex.UserIp, ex.LogTime, ex.Message, ex.ErrorPage, ex.ExceptionType }); return(ret); }
public void RetrievePages_Ok() { Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "LogTime", Order = "desc" }, null, null)); Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "ErrorPage", Order = "desc" }, null, null)); Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "UserId", Order = "desc" }, null, null)); Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "UserIp", Order = "desc" }, null, null)); }
/// <summary> /// 資料查詢方法 /// </summary> /// <param name="options"></param> /// <returns></returns> protected QueryData <Bootstrap.DataAccess.Exceptions> Query(QueryPageOptions options) { var data = ExceptionsHelper.RetrievePages(options.ToPaginationOption(), StartTime, EndTime); return(data.ToQueryData()); }