Exemple #1
0
        public static IResult <T> CreateFailed(int eventId,
                                               int errorCode, string correlationId, string errorText)
        {
            if (ResultCode.IsSuccess(errorCode))
            {
                throw new ArgumentOutOfRangeException(nameof(errorCode));
            }

            return(new Result <T>()
            {
                EventId = eventId,
                ErrorCode = errorCode,
                ErrorText = errorText,
                CorrelationId = correlationId
            });
        }