コード例 #1
0
                public async Task <Response> Handle(Command request, CancellationToken cancellationToken)
                {
                    // ignore undecided ones for now (they could pop again later...)
                    if (request.Score == ScoreType.UNDECIDED)
                    {
                        return(new());
                    }

                    var user = await CurrentUserAccessor.CurrentUser();

                    var rating = new Models.Rating()
                    {
                        User      = user,
                        TitleId   = request.MovieId,
                        SessionId = request.SessionId,
                        Score     = request.Score
                    };

                    SessionRepository.AddRating(rating);
                    await SessionRepository.Save();

                    return(new());
                }