示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagerResponseBase{TErrorCode}"/> class.
        /// </summary>
        /// <param name="errorCode">The error code.</param>
        /// <param name="exception">The exception.</param>
        public ManagerResponseBase(TErrorCode errorCode, Exception exception)
        {
            EnsureArg.IsNotNull <TErrorCode>(errorCode, nameof(errorCode));
            EnsureArg.IsNotNull(exception, nameof(exception));

            ErrorRecords = new ErrorRecords <TErrorCode>
            {
                new ErrorRecord <TErrorCode>(errorCode, exception)
            };
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagerResponseBase{TErrorCode}"/> class.
        /// </summary>
        /// <param name="errorCode">The error code.</param>
        /// <param name="message">The message.</param>
        public ManagerResponseBase(TErrorCode errorCode, string message)
        {
            EnsureArg.IsNotNull <TErrorCode>(errorCode, nameof(errorCode));
            EnsureArg.IsNotEmptyOrWhiteSpace(message, nameof(message));

            ErrorRecords = new ErrorRecords <TErrorCode>
            {
                new ErrorRecord <TErrorCode>(errorCode, message)
            };
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagerResponseBase{TErrorCode}"/> class.
 /// </summary>
 protected ManagerResponseBase()
 {
     ErrorRecords = new ErrorRecords <TErrorCode>();
 }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagerResponseBase{TErrorCode}"/> class.
        /// </summary>
        /// <param name="errorRecords">The error records.</param>
        public ManagerResponseBase(ErrorRecords <TErrorCode> errorRecords)
        {
            EnsureArg.IsNotNull(errorRecords, nameof(errorRecords));

            ErrorRecords = errorRecords;
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagerResponse{TErrorCode}"/> class.
 /// </summary>
 /// <param name="errorRecords">The error records.</param>
 public ManagerResponse(ErrorRecords <TErrorCode> errorRecords)
     : base(errorRecords)
 {
     Ids = Array.Empty <long>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagerResponseTyped{TErrorCode, TResult}"/> class.
 /// </summary>
 /// <param name="errorRecords">The error records.</param>
 public ManagerResponseTyped(ErrorRecords <TErrorCode> errorRecords)
     : base(errorRecords)
 {
     Results = Array.Empty <TResult>();
 }