private async Task HandleRiderRatingChangedEvent(RiderRatingChangedEvent riderRatingChanged)
        {
            using (var scope = _serviceScopeFactory.CreateScope())
            {
                IRiderService riderService = scope.ServiceProvider.GetRequiredService <IRiderService>();

                var updatedRider = new Rider
                {
                    IdRider       = riderRatingChanged.IdRider,
                    AverageRating = riderRatingChanged.newAverageRating
                };

                await riderService.UpdateRider(updatedRider);
            }
        }
Exemple #2
0
        public async Task <IActionResult> UpdateRider([FromBody] DTO.Rider rider)
        {
            await riderService.UpdateRider(rider);

            return(Ok());
        }