/// <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) }; }
/// <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) }; }
/// <summary> /// Initializes a new instance of the <see cref="ManagerResponseBase{TErrorCode}"/> class. /// </summary> protected ManagerResponseBase() { ErrorRecords = new ErrorRecords <TErrorCode>(); }
/// <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; }
/// <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>(); }