Hi,
Im trying to implement a like/dislike feature for Discussion Messages. To do this I am using two buttons one which saves rating of 1 (dislike) and one which saves rating as 5 (like).
For each message I am trying to then calculate how many likes /dislike it has by using :
var msgRatings = DependencyInjectionFactory.Resolve<IRatingBLL>()
.GetRatingCollection(msg.Id,
(int)EntityType.SnDiscussionMessageEntity, false, 100000);
however this seems to return all ratings currently stored in the database.
Similarly when I save a rating it seems to save it against the same item even if i pass different Guids:
protected void Like(object sender, EventArgs e)
{
LinkButton lb = (LinkButton) sender;
DependencyInjectionFactory.Resolve<IRatingBLL>()
.SaveRating(5, SecurityUtility.GetUserId(), Guid.Parse(lb.CommandArgument),
(int) EntityType.SnDiscussionMessageEntity);
}
Can someone explain what I am doing wrong and why this is not working?
Thanks