I'm hoping someone can give me some help with a custom widget I'm developing. I think all I actually need is syntax help.
I'm creating a custom widget to display the most discussed blog posts. That has gone well, and I have the ability to specify a certain number of blog post summaries to show up, ordered by how many comments they have. This is the code I'm using:
// this is a public property on the control
var recentPosts = App.WorkWith().BlogPosts().Publihed().OrderByDescending(b => b.Comments.Count).Get().Take(count);
rptblogMostDiscussed.DataSource = recentPosts;
What I would like, is to add a second public property, so that when placing the control on a page, you can specify for how many days comments should be considered. For example, if I set it to 14, it would only consider comments made in the last 2 weeks, instead of the way it currently works which uses a lifetime grand total of all comments.
Can someone help me as to how I would do this?