Deal of the Day

Home » Main » Manning Forums » 2007 » LINQ in Action

Thread: Adding extra property in datacontext

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 0 - Pages: 1 Threads: [ Previous | Next ]
dmitri

Posts: 1
From: London
Registered: 10/16/08
Adding extra property in datacontext
Posted: Oct 16, 2008 7:09 AM
  Click to reply to this thread Reply

Hello,

I've created extra property in my Class Story which should return the count of the comments for particular Story object.

public int CommentCount
{
get
{
return this.StoryComments.Count(c => c.IsActive == true);
}
}

I use a linqdatasource to retrieve data, but all I get is 0 for comment count.

Is there something Iím missing here?

Thanks in advance Dmitri

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor