public void CreateNewRating(string PostId, MessageRatingType type, Account account) { _dbContext.MessageRating.Add(new MessageRating() { Account = account, Id = Guid.NewGuid(), Message = _dbContext.Message.Where(m => m.Id.ToString() == PostId).FirstOrDefault(), Type = type }); _dbContext.SaveChanges(); }
public MessageRating(IUserBasic ratingUser, Message ratedMessage, MessageRatingType messageRatingType) { this._CMSContentRating = new CMSContentRating(ratingUser, ratedMessage.CMSContent, (short)(messageRatingType)); }
public MessageRating(IUserBasic ratingUser, int messageId, MessageRatingType messageRatingType) { this._CMSContentRating = new CMSContentRating(ratingUser, messageId, (short)(messageRatingType)); }
public List <MessageRating> GetMessageRating(string PostId, MessageRatingType ratingType) { return(_dbContext.MessageRating.Where(rating => rating.Message.Id.ToString() == PostId && rating.Type == ratingType).ToList()); }