Beispiel #1
0
        public static BarberRatingStat ToBarberRatingStat(this BarberFeedbackCollection collection)
        {
            if (collection == null)
            {
                return(null);
            }

            return(new BarberRatingStat()
            {
                BarberId = collection.BarberId,
                AverageValue = collection.AverageRating,
                FeedbackCount = collection.FeedbackList.Length
            });
        }
Beispiel #2
0
        public static BarberFeedback[] ToBarberFeedback(this BarberFeedbackCollection collection)
        {
            if (collection == null)
            {
                return(null);
            }

            return(collection.FeedbackList?.Select(x => new BarberFeedback()
            {
                Timestamp = x.Timestamp,
                Rating = x.Rating,
                Body = x.Body
            }).ToArray());
        }