From 2014dd6e0c6fdd82e49daec4a43c2a455cd9046d Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 6 Jan 2012 09:22:39 +0000 Subject: [PATCH] Fixed a bug with Board.getThreads pageouter optimization --- FLocal.Common/dataobjects/Board.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/FLocal.Common/dataobjects/Board.cs b/FLocal.Common/dataobjects/Board.cs index ff64ac2..de17e57 100644 --- a/FLocal.Common/dataobjects/Board.cs +++ b/FLocal.Common/dataobjects/Board.cs @@ -108,6 +108,12 @@ namespace FLocal.Common.dataobjects { } } + public int totalThreadsExcludingSubboards { + get { + return this.totalThreads - this.subBoards.Sum(board => board.totalThreads); + } + } + private string _name; public string name { get { @@ -323,7 +329,7 @@ namespace FLocal.Common.dataobjects { } public IEnumerable getThreads(Diapasone diapasone, SortSpec[] sortBy) { - diapasone.total = this.totalThreads; + diapasone.total = this.totalThreadsExcludingSubboards; return Thread.LoadByIds( from stringId in Config.instance.mainConnection.LoadIdsByConditions( Thread.TableSpec.instance, @@ -340,7 +346,7 @@ namespace FLocal.Common.dataobjects { } public IEnumerable getThreads(Diapasone diapasone, bool isAscending) { - diapasone.total = this.totalThreads; + diapasone.total = this.totalThreadsExcludingSubboards; return this.getThreads( diapasone, new SortSpec[] {