Add project files.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="ErrorDetailsDto.cs">
|
||||
// Heath
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
using Lib.Common.LoggingAPI.Service.Constants;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lib.Common.LoggingAPI.Service.DataTransferObjects.Error
|
||||
{
|
||||
/// <summary>
|
||||
/// The service error details transfer object.
|
||||
/// </summary>
|
||||
public class ErrorDetailsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the service error code.
|
||||
/// </summary>
|
||||
/// <example>healthy</example>
|
||||
[DisplayName(DisplayNames.ErrorCode)]
|
||||
[JsonPropertyName(DisplayNames.ErrorCode)]
|
||||
public string? ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service error message.
|
||||
/// </summary>
|
||||
/// <example>This is an example message.</example>
|
||||
[DisplayName(DisplayNames.Message)]
|
||||
[JsonPropertyName(DisplayNames.Message)]
|
||||
public string? Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service target.
|
||||
/// </summary>
|
||||
/// <example>healthy</example>
|
||||
[DisplayName(DisplayNames.Target)]
|
||||
[JsonPropertyName(DisplayNames.Target)]
|
||||
public string? Target { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="HttpErrorDto.cs">
|
||||
// Heath
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
using Lib.Common.LoggingAPI.Service.Constants;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lib.Common.LoggingAPI.Service.DataTransferObjects.Error
|
||||
{
|
||||
/// <summary>
|
||||
/// The service HTTP error data transfer object.
|
||||
/// </summary>
|
||||
public class HttpErrorDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the error.
|
||||
/// </summary>
|
||||
[DisplayName(DisplayNames.Error)]
|
||||
[JsonPropertyName(DisplayNames.Error)]
|
||||
public ErrorDetailsDto Error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="HttpErrorDto{TMessage}"/>
|
||||
/// with custom parameters.
|
||||
/// </summary>
|
||||
/// <param name="message">The HTTP error message.</param>
|
||||
/// <param name="errorCode">The HTTP error code.</param>
|
||||
/// <param name="target">The HTTP error target.</param>
|
||||
public HttpErrorDto(
|
||||
string? message,
|
||||
string? errorCode,
|
||||
string? target)
|
||||
{
|
||||
this.Error = new ErrorDetailsDto
|
||||
{
|
||||
ErrorCode = errorCode,
|
||||
Message = message,
|
||||
Target = target,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user