From 2254b6e97a5ef71738bdf46b321e8602f1310cb5 Mon Sep 17 00:00:00 2001 From: CwistSilver <87319028+CwistSilver@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:16:53 +0100 Subject: [PATCH] Migrate project to .NET Standard 2.1 --- Dynu.API.Tests/DynuSharp.Test.csproj | 2 +- DynuSharp/Client/Connection.cs | 5 +---- DynuSharp/Data/Dns/DnsIpUpdate.cs | 16 ++++++++-------- DynuSharp/Data/Dns/Record/DnsRecordBase.cs | 10 +++++----- .../Data/DnsWebRedirect/DnsWebRedirectBase.cs | 10 +++++----- DynuSharp/Data/Email/DynuEmailAccount.cs | 4 ++-- DynuSharp/Data/Email/DynuEmailListBase.cs | 4 ++-- DynuSharp/Data/Email/QueuedEmailMessage.cs | 2 +- .../Data/Email/Type/DynuEmailServiceBase.cs | 2 +- DynuSharp/Data/Monitor/MonitorBase.cs | 10 +++++----- DynuSharp/DynuSharp.csproj | 5 ++++- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Dynu.API.Tests/DynuSharp.Test.csproj b/Dynu.API.Tests/DynuSharp.Test.csproj index 7b3cad6..30178c6 100644 --- a/Dynu.API.Tests/DynuSharp.Test.csproj +++ b/Dynu.API.Tests/DynuSharp.Test.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0;net8.0 + net8.0 enable enable diff --git a/DynuSharp/Client/Connection.cs b/DynuSharp/Client/Connection.cs index 225ac84..9139739 100644 --- a/DynuSharp/Client/Connection.cs +++ b/DynuSharp/Client/Connection.cs @@ -40,10 +40,7 @@ private async Task CreateAndInitializeHttpClientAsync() .WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); - var handler = new SocketsHttpHandler - { - PooledConnectionLifetime = TimeSpan.FromMinutes(15) - }; + var handler = new HttpClientHandler(); var policyHandler = new PolicyHttpMessageHandler(retryPolicy) { diff --git a/DynuSharp/Data/Dns/DnsIpUpdate.cs b/DynuSharp/Data/Dns/DnsIpUpdate.cs index e554975..378eb79 100644 --- a/DynuSharp/Data/Dns/DnsIpUpdate.cs +++ b/DynuSharp/Data/Dns/DnsIpUpdate.cs @@ -7,13 +7,13 @@ public class DnsIpUpdate /// The unique identifier for the IP update. /// [JsonPropertyName("id")] - public int Id { get; init; } + public int Id { get; set; } /// /// The identifier for the server's response to the update request. /// [JsonPropertyName("responseId")] - public string ResponseId { get; init; } = string.Empty; + public string ResponseId { get; set; } = string.Empty; /// /// The status of the update operation, represented as an enumeration. @@ -25,37 +25,37 @@ public class DnsIpUpdate /// The IPv4 address involved in the update. /// [JsonPropertyName("ipv4Address")] - public string? IPv4Address { get; init; } = string.Empty; + public string? IPv4Address { get; set; } = string.Empty; /// /// The IPv6 address involved in the update. /// [JsonPropertyName("ipv6Address")] - public string? IPv6Address { get; init; } = string.Empty; + public string? IPv6Address { get; set; } = string.Empty; /// /// The query string used in the update request. /// [JsonPropertyName("queryString")] - public string QueryString { get; init; } = string.Empty; + public string QueryString { get; set; } = string.Empty; /// /// The User-Agent string from the client making the update request. /// [JsonPropertyName("userAgent")] - public string UserAgent { get; init; } = string.Empty; + public string UserAgent { get; set; } = string.Empty; /// /// Indicates whether the update was performed over SSL. /// [JsonPropertyName("ssl")] - public bool SSL { get; init; } + public bool SSL { get; set; } /// /// The date and time when the update was performed. /// [JsonPropertyName("updatedOn")] - public DateTime UpdatedOn { get; init; } + public DateTime UpdatedOn { get; set; } public override bool Equals(object? obj) { diff --git a/DynuSharp/Data/Dns/Record/DnsRecordBase.cs b/DynuSharp/Data/Dns/Record/DnsRecordBase.cs index 4b158c4..80e4640 100644 --- a/DynuSharp/Data/Dns/Record/DnsRecordBase.cs +++ b/DynuSharp/Data/Dns/Record/DnsRecordBase.cs @@ -20,7 +20,7 @@ public class DnsRecordBase /// [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } /// /// The unique identifier for the domain associated with the DNS record. @@ -34,7 +34,7 @@ public class DnsRecordBase /// [JsonPropertyName("domainName")] [IgnoreOnPost] - public string DomainName { get; init; } = string.Empty; + public string DomainName { get; set; } = string.Empty; /// /// The name of the node associated with the DNS record. @@ -48,7 +48,7 @@ public class DnsRecordBase /// [JsonPropertyName("hostname")] [IgnoreOnPost] - public string Hostname { get; init; } = string.Empty; + public string Hostname { get; set; } = string.Empty; /// /// The type of the DNS record. This can be one of several enumerated values representing different DNS record types. @@ -68,7 +68,7 @@ public class DnsRecordBase /// [JsonPropertyName("content")] [IgnoreOnPost] - public string Content { get; init; } = string.Empty; + public string Content { get; set; } = string.Empty; /// /// The date and time when the DNS record was last updated. @@ -76,7 +76,7 @@ public class DnsRecordBase /// [JsonPropertyName("updatedOn")] [IgnoreOnPost] - public DateTime UpdatedOn { get; init; } + public DateTime UpdatedOn { get; set; } public override bool Equals(object? obj) { diff --git a/DynuSharp/Data/DnsWebRedirect/DnsWebRedirectBase.cs b/DynuSharp/Data/DnsWebRedirect/DnsWebRedirectBase.cs index b6ff40c..1f9b433 100644 --- a/DynuSharp/Data/DnsWebRedirect/DnsWebRedirectBase.cs +++ b/DynuSharp/Data/DnsWebRedirect/DnsWebRedirectBase.cs @@ -11,7 +11,7 @@ public class DnsWebRedirectBase /// [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } /// /// The unique identifier for the domain associated with the web redirect. @@ -19,7 +19,7 @@ public class DnsWebRedirectBase /// [JsonPropertyName("domainId")] [IgnoreOnPost] - public int DomainId { get; init; } + public int DomainId { get; set; } /// /// The name of the domain associated with the web redirect. @@ -27,7 +27,7 @@ public class DnsWebRedirectBase /// [JsonPropertyName("domainName")] [IgnoreOnPost] - public string DomainName { get; init; } = string.Empty; + public string DomainName { get; set; } = string.Empty; /// /// The name of the node associated with the web redirect. @@ -43,7 +43,7 @@ public class DnsWebRedirectBase /// [JsonPropertyName("hostname")] [IgnoreOnPost] - public string Hostname { get; init; } = string.Empty; + public string Hostname { get; set; } = string.Empty; /// /// The type of web redirect, which can either be URL forwarding (UF) or port forwarding (PF). @@ -63,7 +63,7 @@ public class DnsWebRedirectBase /// [JsonPropertyName("updatedOn")] [IgnoreOnPost] - public DateTime UpdatedOn { get; init; } + public DateTime UpdatedOn { get; set; } /// /// Indicates whether to use dynamic IPv4 address for the redirect. diff --git a/DynuSharp/Data/Email/DynuEmailAccount.cs b/DynuSharp/Data/Email/DynuEmailAccount.cs index 8db1eb8..99dd58e 100644 --- a/DynuSharp/Data/Email/DynuEmailAccount.cs +++ b/DynuSharp/Data/Email/DynuEmailAccount.cs @@ -6,7 +6,7 @@ public sealed class DynuEmailAccount { [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } [JsonPropertyName("emailId")] public int EmailId { get; set; } @@ -16,7 +16,7 @@ public sealed class DynuEmailAccount [JsonPropertyName("unicodeEmailAddress")] [IgnoreOnPost] - public string UnicodeEmailAddress { get; init; } = string.Empty; + public string UnicodeEmailAddress { get; set; } = string.Empty; [JsonPropertyName("state")] public EmailAccountState State { get; set; } diff --git a/DynuSharp/Data/Email/DynuEmailListBase.cs b/DynuSharp/Data/Email/DynuEmailListBase.cs index 2703175..f4078f0 100644 --- a/DynuSharp/Data/Email/DynuEmailListBase.cs +++ b/DynuSharp/Data/Email/DynuEmailListBase.cs @@ -6,11 +6,11 @@ public class DynuEmailListBase { [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } [JsonPropertyName("domainId")] [IgnoreOnPost] - public int DomainId { get; init; } + public int DomainId { get; set; } [JsonPropertyName("domainName")] public string DomainName { get; set; } = string.Empty; diff --git a/DynuSharp/Data/Email/QueuedEmailMessage.cs b/DynuSharp/Data/Email/QueuedEmailMessage.cs index 027315e..581fa62 100644 --- a/DynuSharp/Data/Email/QueuedEmailMessage.cs +++ b/DynuSharp/Data/Email/QueuedEmailMessage.cs @@ -15,7 +15,7 @@ public sealed class QueuedEmailMessage [JsonPropertyName("tries")] [IgnoreOnPost] - public int Tries { get; init; } + public int Tries { get; set; } [JsonPropertyName("createdOn")] [IgnoreOnPost] diff --git a/DynuSharp/Data/Email/Type/DynuEmailServiceBase.cs b/DynuSharp/Data/Email/Type/DynuEmailServiceBase.cs index e083e87..70319f5 100644 --- a/DynuSharp/Data/Email/Type/DynuEmailServiceBase.cs +++ b/DynuSharp/Data/Email/Type/DynuEmailServiceBase.cs @@ -8,7 +8,7 @@ public class DynuEmailServiceBase { [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; diff --git a/DynuSharp/Data/Monitor/MonitorBase.cs b/DynuSharp/Data/Monitor/MonitorBase.cs index 9e1657a..8ba4f91 100644 --- a/DynuSharp/Data/Monitor/MonitorBase.cs +++ b/DynuSharp/Data/Monitor/MonitorBase.cs @@ -13,7 +13,7 @@ public class MonitorBase /// [JsonPropertyName("id")] [IgnoreOnPost] - public int Id { get; init; } + public int Id { get; set; } /// /// The name of the monitor. @@ -39,7 +39,7 @@ public class MonitorBase /// [JsonPropertyName("state")] [IgnoreOnPost] - public MonitorState State { get; init; } + public MonitorState State { get; set; } /// /// A boolean value indicating whether the monitor is paused. @@ -53,7 +53,7 @@ public class MonitorBase /// [JsonPropertyName("lastCheck")] [IgnoreOnPost] - public DateTime LastCheck { get; init; } + public DateTime LastCheck { get; set; } /// /// The date and time of the next check to be performed by the monitor. @@ -61,7 +61,7 @@ public class MonitorBase /// [JsonPropertyName("nextCheck")] [IgnoreOnPost] - public DateTime? NextCheck { get; init; } + public DateTime? NextCheck { get; set; } /// /// The date and time of the last successful check performed by the monitor. @@ -69,7 +69,7 @@ public class MonitorBase /// [JsonPropertyName("lastSuccessfulCheck")] [IgnoreOnPost] - public DateTime LastSuccessfulCheck { get; init; } + public DateTime LastSuccessfulCheck { get; set; } public override bool Equals(object? obj) { diff --git a/DynuSharp/DynuSharp.csproj b/DynuSharp/DynuSharp.csproj index a92899f..02a208a 100644 --- a/DynuSharp/DynuSharp.csproj +++ b/DynuSharp/DynuSharp.csproj @@ -1,7 +1,8 @@  - net6.0;net7.0;net8.0 + netstandard2.1 + 11 enable enable DynuSharp @@ -36,5 +37,7 @@ + +