示例#1
0
        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);
            }
        }
示例#2
0
        public async Task <IActionResult> UpdateRider([FromBody] DTO.Rider rider)
        {
            await riderService.UpdateRider(rider);

            return(Ok());
        }