using System.Net; namespace Leanetec.EConnect.Domain.Entities; public record Response() where TError : class { public bool Ok { get; init; } private HttpStatusCode? _statusCode; public HttpStatusCode StatusCode { get => _statusCode ?? (Ok ? HttpStatusCode.OK : HttpStatusCode.InternalServerError); init => _statusCode = value; } public int StatusCodeInt => (int)StatusCode; public TError? Error { get; init; } } public record Response : Response where TData : class where TError : class { public TData? Data { get; init; } }