From 6fa9ff2e2f581de7b85a518c75febe8998fc38ee Mon Sep 17 00:00:00 2001 From: Artsiom Tsybulko Date: Mon, 7 Jul 2025 11:53:58 +0300 Subject: [PATCH] 40399 - add .net standard support --- csharp-generator-config.json | 2 +- .../Client/ApiClient.cs | 1 - .../Client/ClientUtils.cs | 6 ------ .../Client/Configuration.cs | 5 ----- .../Model/EncryptedRCLItem.cs | 2 +- .../Model/EncryptedRCLResult.cs | 2 +- .../Model/LicenseItem.cs | 2 +- .../Model/LicenseResult.cs | 2 +- .../Model/TextFieldType.cs | 12 +++++++++++- .../Regula.DocumentReader.WebClient.csproj | 2 +- 10 files changed, 17 insertions(+), 19 deletions(-) diff --git a/csharp-generator-config.json b/csharp-generator-config.json index 9e04e42..e3b7da9 100644 --- a/csharp-generator-config.json +++ b/csharp-generator-config.json @@ -2,7 +2,7 @@ "packageName": "Regula.DocumentReader.WebClient", "library": "httpclient", "nullableReferenceTypes": true, - "targetFramework": "net8.0", + "targetFramework": "netstandard2.0", "typeMappings" : { "ContainerListListInner": "ResultItem", "AuthenticityCheckResultListInner": "AuthenticityCheckResultItem" diff --git a/src/Regula.DocumentReader.WebClient/Client/ApiClient.cs b/src/Regula.DocumentReader.WebClient/Client/ApiClient.cs index cc2e6d6..8281845 100644 --- a/src/Regula.DocumentReader.WebClient/Client/ApiClient.cs +++ b/src/Regula.DocumentReader.WebClient/Client/ApiClient.cs @@ -22,7 +22,6 @@ using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; diff --git a/src/Regula.DocumentReader.WebClient/Client/ClientUtils.cs b/src/Regula.DocumentReader.WebClient/Client/ClientUtils.cs index 39244ea..95255fb 100644 --- a/src/Regula.DocumentReader.WebClient/Client/ClientUtils.cs +++ b/src/Regula.DocumentReader.WebClient/Client/ClientUtils.cs @@ -100,12 +100,6 @@ public static string ParameterToString(object obj, IReadableConfiguration config // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - if (obj is DateOnly dateOnly) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15 - return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; if (obj is ICollection collection) { diff --git a/src/Regula.DocumentReader.WebClient/Client/Configuration.cs b/src/Regula.DocumentReader.WebClient/Client/Configuration.cs index b081a47..af36f12 100644 --- a/src/Regula.DocumentReader.WebClient/Client/Configuration.cs +++ b/src/Regula.DocumentReader.WebClient/Client/Configuration.cs @@ -58,11 +58,6 @@ public class Configuration : IReadableConfiguration string.Format("Error calling {0}: {1}", methodName, response.RawContent), response.RawContent, response.Headers); } - if (status == 0) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); - } return null; }; diff --git a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs index 0fa7e0a..0ec071c 100644 --- a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs +++ b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs @@ -56,7 +56,7 @@ protected EncryptedRCLItem() { } /// /// Base64 encoded data /* - [B@1b8185d8 + [B@36b75ee4 */ [DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)] public byte[] EncryptedRCL { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs index 49614e4..6c492a3 100644 --- a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs +++ b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs @@ -62,7 +62,7 @@ protected EncryptedRCLResult() { } /// /// Base64 encoded data /* - [B@1b8185d8 + [B@36b75ee4 */ [DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)] public byte[] EncryptedRCL { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs b/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs index 5232cd8..c62f395 100644 --- a/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs +++ b/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs @@ -56,7 +56,7 @@ protected LicenseItem() { } /// /// Base64 encoded data /* - [B@168f0550 + [B@46cb6573 */ [DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)] public byte[] License { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs b/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs index 4b37b40..bacf0af 100644 --- a/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs +++ b/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs @@ -62,7 +62,7 @@ protected LicenseResult() { } /// /// Base64 encoded data /* - [B@168f0550 + [B@46cb6573 */ [DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)] public byte[] License { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/TextFieldType.cs b/src/Regula.DocumentReader.WebClient/Model/TextFieldType.cs index d22b30e..33c58ca 100644 --- a/src/Regula.DocumentReader.WebClient/Model/TextFieldType.cs +++ b/src/Regula.DocumentReader.WebClient/Model/TextFieldType.cs @@ -3264,7 +3264,17 @@ public enum TextFieldType /// /// Enum FT_NATIONALITY_CODE_ALPHA2 for value: 697 /// - FT_NATIONALITY_CODE_ALPHA2 = 697 + FT_NATIONALITY_CODE_ALPHA2 = 697, + + /// + /// Enum FT_FIRST_ISSUE_DATE_CHECK_DIGIT for value: 698 + /// + FT_FIRST_ISSUE_DATE_CHECK_DIGIT = 698, + + /// + /// Enum FT_FIRST_ISSUE_DATE_CHECKSUM for value: 699 + /// + FT_FIRST_ISSUE_DATE_CHECKSUM = 699 } } diff --git a/src/Regula.DocumentReader.WebClient/Regula.DocumentReader.WebClient.csproj b/src/Regula.DocumentReader.WebClient/Regula.DocumentReader.WebClient.csproj index 01ca3eb..a0680cd 100644 --- a/src/Regula.DocumentReader.WebClient/Regula.DocumentReader.WebClient.csproj +++ b/src/Regula.DocumentReader.WebClient/Regula.DocumentReader.WebClient.csproj @@ -1,7 +1,7 @@ false - net8.0 + netstandard2.0 Regula.DocumentReader.WebClient Alexander Satsukevich Regula Ltd.