public void LogRating(int rating, string contentName, string contentType, string contentId, Dictionary <string, object> customAttributes = null) { var answersEvent = new RatingEvent(); answersEvent.PutRating(rating); answersEvent.PutContentName(contentName); answersEvent.PutContentType(contentType); answersEvent.PutContentId(contentId); answersEvent.PutCustomAttributes(customAttributes); Bindings.AnswersKit.Answers.Instance.LogRating(answersEvent); }
public async Task <RatingEvent> LogRatingEvent(int playerId, int rating, string type = "game", string message = "", bool saveChanges = true, int?gameId = null) { RatingEvent entry = new RatingEvent { PlayerId = playerId, Rating = rating, Type = type, Message = message, GameId = gameId }; _context.RatingEvent.Add(entry); if (saveChanges) { await _context.SaveChangesAsync(); } return(entry); }