private string GetDetail(ReviewDetailType detailType) { string retString = null; if (detailType == ReviewDetailType.Summary) { retString = Model.Summary; } else if (detailType == ReviewDetailType.MediaTitle) { retString = Model.Media?.Title?.UserPreferred; } else if (detailType == ReviewDetailType.Rating) { retString = $"Rating: {Model.Rating} / {Model.RatingAmount}"; } return(retString); }
public ReviewViewModel(Review model, ReviewDetailType primaryReviewDetailType, ReviewDetailType secondaryReviewDetailType) : base(model) { TitleText = GetDetail(primaryReviewDetailType); DetailPrimaryText = GetDetail(secondaryReviewDetailType); }