Пример #1
0
        public void ShowCourierRating(int loggedCourierId)
        {
            float courierRating = _packingListService.CalculateTotalCourierRating(loggedCourierId);

            if (courierRating == 0)
            {
                Console.WriteLine("There has been a connection issue or you have no packing lists to calculate average from");
                return;
            }

            Console.WriteLine($"Your average courier rating is: {courierRating}");

            var packingListInfos = _packingListService.GetCourierPackingListInfos(loggedCourierId);

            int i = 1;

            foreach (var packingListInfo in packingListInfos)
            {
                Console.WriteLine($"{i}. {packingListInfo.FileName}, Rating: {packingListInfo.CourierRating}");
                i++;
            }
        }
Пример #2
0
        public float GetRating([FromQuery] int courierId)
        {
            var courierRating = _packingListService.CalculateTotalCourierRating(courierId);

            return(courierRating);
        }