Esempio n. 1
0
            public Task <Unit> Handle(LeaveSceneCommand request, CancellationToken cancellationToken)
            {
                return(Task.Run(() =>
                {
                    var result = _battleService.LeaveScene(request.UserId, request.SceneId);
                    if (!result)
                    {
                        throw new CannotPerformOperationException("User is not in battle");
                    }

                    return Unit.Value;
                }));
            }