using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BookApp.Model { public class Star { public static int MaxStars { get; private set; } = 5; public int CurrentRating { get; private set; } public Star(int rating) { if (rating < 0 || rating > MaxStars) throw new ArgumentOutOfRangeException("Rating should be between 0 and MaxStars."); CurrentRating = rating; } public IEnumerable Rating { get { return Enumerable.Range(0, MaxStars); } } } }