Rate a target
Explains how to rate a target.
In the Optimizely Community API, a rating is represented with the Rating class.
An instance of the Rating class is constructed with
- a reference to the user submitting the rating (represented by the
Referenceclass) - a reference to the target being rated (represented by the
Referenceclass) - a rating value (represented by the
RatingValueclass)
You can construct an instance of the Rating class as shown below:
var rater = Reference.Create("user://identifier/for/a/user");
var target = Reference.Create("resource://identifier/for/a/resource");
var value = new RatingValue(5);
var rating = new Rating(rater, target, value);Updated about 2 months ago
Next