示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorResponse" /> class.
 /// </summary>
 /// <param name="error">error (required).</param>
 public ErrorResponse(ErrorDetail error = default(ErrorDetail))
 {
     // to ensure "error" is required (not null)
     if (error == null)
     {
         throw new InvalidDataException("error is a required property for ErrorResponse and cannot be null");
     }
     else
     {
         this.Error = error;
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorResponse" /> class.
 /// </summary>
 /// <param name="error">error (required).</param>
 public ErrorResponse(ErrorDetail error = default(ErrorDetail))
 {
     // to ensure "error" is required (not null)
     this.Error = error ?? throw new ArgumentNullException("error is a required property for ErrorResponse and cannot be null");
 }