Untitled

mail@pastecode.io avatar
unknown
plain_text
21 days ago
689 B
2
Indexable
Never
using Newtonsoft.Json;

namespace CSZ.Commons.Middlewares.ErrorHandling.Models;

public class ErrorResponseModel
{
    public string Message { get; private set; }
    public int StatusCode { get; private set; }
    public string CorrelationId { get; private set; }
    public string ErrorCode { get; private set; }
    
    public ErrorResponseModel(string message, int statusCode, string correlationId, string errorCode)
    {
        Message = message;
        StatusCode = statusCode;
        CorrelationId = correlationId;
        ErrorCode = errorCode;
    }

    public override string ToString()
    {
        return JsonConvert.SerializeObject(this);
    }
}
Leave a Comment