namespace DealerSelection.Common.Logging; public class RequestInfo { public RequestInfo(string hostName, string httpMethod, string uri, DateTime startDate) { HostName = hostName; HttpMethod = httpMethod; Uri = uri; StartDate = startDate; } public string HostName { get; set; } public string HttpMethod { get; set; } public string Uri { get; set; } public DateTime? StartDate { get; set; } public int? RecordId { get; set; } public int? BuId { get; set; } public string? SecurityContext { get; set; } public string? ContentBody { get; set; } public string? ExceptionStack { get; set;} public string? RealException { get; set; } public string? InnerException { get; set; } public override string ToString() { return $"{nameof(BuId)}:{ BuId},{nameof(RecordId)}:{RecordId},{nameof(HostName)}:{HostName}," + $"{nameof(HttpMethod)}:{HttpMethod},{nameof(Uri)}:{Uri},{nameof(StartDate)}:{StartDate}," + $"{nameof(SecurityContext)}:{SecurityContext},{nameof(ContentBody)}:{ContentBody}," + $"{nameof(ExceptionStack)}:{ExceptionStack},{nameof(RealException)}:{RealException},{nameof(InnerException)}:{InnerException}"; } public string BuildRequestData() { if(string.IsNullOrWhiteSpace(ContentBody)) { return Uri; } return $"{Uri} with {ContentBody}"; } }