Exemplo n.º 1
0
        public async Task <UpdateSessionResponse> Handle(UpdateSessionRequest request, CancellationToken cancellationToken)
        {
            var errorMessage = string.Empty;
            var response     = 0;

            try
            {
                response = await _infoServiceWrapper.UpdateSession(request.AccountId, request.SessionCode, request.SessionName, request.SessionDate, request.SessionStartTime,
                                                                   request.SessionEndTime, request.Score, request.IsDuplicateScoreAllowed, request.ExitFor, request.AttendingAnswerCode, request.AttendedAnswerCode, request.Room, request.SessionKey);
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
            }
            return(await Task.FromResult(new UpdateSessionResponse
            {
                IsServiceCallSuccess = string.IsNullOrEmpty(errorMessage) ? true : false,
                ErrorMessage = errorMessage,
                UpdateSessionResult = response
            }));
        }