 <pre><code>[NotMapped] public int ThreadsInBoard { get { ForumContextContainer ctx = new ForumContextContainer(); int thr = ctx.ThreadSet.Count(p =&gt; p.BoardID == this.BoardID); } } </code></pre> <p>assuming this class has the boardId property</p>