From cd07ca1d545c8d0a52ce29e9038dbe179e2f487b Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Mon, 4 Dec 2023 14:57:13 +0330 Subject: [PATCH] update client --- .../ConnectedService.json | 10 +- .../ContentsGeneratedServices/OpenAPI.cs | 674 +++++++++++++++--- .../ContentsGeneratedServices/OpenAPI.nswag | 10 +- .../OpenAPI.nswag.json | 304 +++++++- ...rvices.ContentsMicroservice.Clients.csproj | 5 +- .../SafeContractResolver.cs | 24 - 6 files changed, 903 insertions(+), 124 deletions(-) delete mode 100644 src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/SafeContractResolver.cs diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/ConnectedService.json b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/ConnectedService.json index 55cb18a..14e939b 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/ConnectedService.json +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/ConnectedService.json @@ -14,7 +14,7 @@ "GenerateTypeScriptClient": false, "GenerateCSharpController": false, "OpenApiToCSharpClientCommand": { - "ClientBaseClass": null, + "ClientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase", "ConfigurationClass": null, "GenerateClientClasses": true, "GenerateClientInterfaces": false, @@ -27,7 +27,7 @@ "WrapDtoExceptions": true, "UseHttpClientCreationMethod": false, "HttpClientType": "System.Net.Http.HttpClient", - "UseHttpRequestMessageCreationMethod": false, + "UseHttpRequestMessageCreationMethod": true, "UseBaseUrl": true, "GenerateBaseUrlProperty": true, "GenerateSyncMethods": false, @@ -61,10 +61,10 @@ "ResponseClass": "SwaggerResponse", "Namespace": "Contents.GeneratedServices", "RequiredPropertiesMustBeDefined": true, - "DateType": "System.DateTimeOffset", + "DateType": "System.DateTime", "JsonConverters": [], "AnyType": "object", - "DateTimeType": "System.DateTimeOffset", + "DateTimeType": "System.DateTime", "TimeType": "System.TimeSpan", "TimeSpanType": "System.TimeSpan", "ArrayType": "System.Collections.Generic.ICollection", @@ -82,7 +82,7 @@ "HandleReferences": false, "GenerateImmutableArrayProperties": false, "GenerateImmutableDictionaryProperties": false, - "JsonSerializerSettingsTransformationMethod": "new EasyMicroservices.ContentsMicroservice.Clients.MyJsonSerializerSettings", + "JsonSerializerSettingsTransformationMethod": "new EasyMicroservices.Cores.Clients.CoreSerializerSettings", "InlineNamedArrays": false, "InlineNamedDictionaries": false, "InlineNamedTuples": true, diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.cs b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.cs index 52bdd9a..81a567d 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.cs +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.cs @@ -19,7 +19,7 @@ namespace Contents.GeneratedServices using System = global::System; [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class CategoryClient + public partial class CategoryClient : EasyMicroservices.Cores.Clients.CoreSwaggerClientBase { private string _baseUrl = ""; private System.Net.Http.HttpClient _httpClient; @@ -34,7 +34,7 @@ public CategoryClient(string baseUrl, System.Net.Http.HttpClient httpClient) private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = new EasyMicroservices.ContentsMicroservice.Clients.MyJsonSerializerSettings(new Newtonsoft.Json.JsonSerializerSettings { }); + var settings = new EasyMicroservices.Cores.Clients.CoreSerializerSettings(new Newtonsoft.Json.JsonSerializerSettings { }); UpdateJsonSerializerSettings(settings); return settings; } @@ -72,7 +72,7 @@ public virtual async System.Threading.Tasks.Task AddAsync( var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -228,7 +228,7 @@ public virtual async System.Threading.Tasks.Task AddBulkAsync(C var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -306,7 +306,85 @@ public virtual async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateCategoryRequestContract body) + { + return UpdateChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateCategoryRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Category/UpdateChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -384,7 +462,85 @@ public virtual async System.Threading.Tasks.Task UpdateBulkAsyn var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateCategoryRequestContractUpdateBulkRequestContract body) + { + return UpdateBulkChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateCategoryRequestContractUpdateBulkRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Category/UpdateBulkChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -462,7 +618,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -540,7 +696,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -618,7 +774,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -696,7 +852,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -774,7 +930,7 @@ public virtual async System.Threading.Tasks.Task AddAsync( var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1376,7 +1532,7 @@ public virtual async System.Threading.Tasks.Task var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1454,7 +1610,7 @@ public virtual async System.Threading.Tasks.Task var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1532,7 +1688,7 @@ public virtual async System.Threading.Tasks.Task UpdateContentW var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1766,7 +1922,7 @@ public virtual async System.Threading.Tasks.Task AddBulkAsync(C var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1825,6 +1981,84 @@ public virtual async System.Threading.Tasks.Task AddBulkAsync(C } } + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateContentRequestContract body) + { + return UpdateChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateContentRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Content/UpdateChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// Success /// A server side error occurred. public virtual System.Threading.Tasks.Task UpdateBulkAsync(UpdateContentRequestContractUpdateBulkRequestContract body) @@ -1844,7 +2078,85 @@ public virtual async System.Threading.Tasks.Task UpdateBulkAsyn var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateContentRequestContractUpdateBulkRequestContract body) + { + return UpdateBulkChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateContentRequestContractUpdateBulkRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Content/UpdateBulkChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -1922,7 +2234,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2000,7 +2312,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2078,7 +2390,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2156,7 +2468,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2234,7 +2546,7 @@ public virtual async System.Threading.Tasks.Task var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2312,7 +2624,7 @@ public virtual async System.Threading.Tasks.Task var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2390,7 +2702,7 @@ public virtual async System.Threading.Tasks.Task HasLanguageAsy var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2836,7 +3148,7 @@ public virtual async System.Threading.Tasks.Task AddAsync( var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2914,7 +3226,7 @@ public virtual async System.Threading.Tasks.Task AddBulkAsync(C var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -2992,7 +3304,85 @@ public virtual async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateLanguageRequestContract body) + { + return UpdateChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateChangedValuesOnlyAsync(UpdateLanguageRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Language/UpdateChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3070,7 +3460,85 @@ public virtual async System.Threading.Tasks.Task UpdateBulkAsyn var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateLanguageRequestContractUpdateBulkRequestContract body) + { + return UpdateBulkChangedValuesOnlyAsync(body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task UpdateBulkChangedValuesOnlyAsync(UpdateLanguageRequestContractUpdateBulkRequestContract body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Language/UpdateBulkChangedValuesOnly"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3148,7 +3616,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3226,7 +3694,7 @@ public virtual async System.Threading.Tasks.Task HardDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3304,7 +3772,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteById var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3382,7 +3850,7 @@ public virtual async System.Threading.Tasks.Task SoftDeleteBulk var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -3460,7 +3928,7 @@ public virtual async System.Threading.Tasks.Task _contents; @@ -4050,7 +4518,7 @@ public string UniqueIdentity } [Newtonsoft.Json.JsonProperty("creationDateTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset CreationDateTime + public System.DateTime CreationDateTime { get { return _creationDateTime; } @@ -4065,7 +4533,7 @@ public System.DateTimeOffset CreationDateTime } [Newtonsoft.Json.JsonProperty("modificationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ModificationDateTime + public System.DateTime? ModificationDateTime { get { return _modificationDateTime; } @@ -4080,7 +4548,7 @@ public System.DateTimeOffset? ModificationDateTime } [Newtonsoft.Json.JsonProperty("deletedDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? DeletedDateTime + public System.DateTime? DeletedDateTime { get { return _deletedDateTime; } @@ -4330,9 +4798,9 @@ public partial class ContentContract : System.ComponentModel.INotifyPropertyChan private long _categoryId; private string _data; private string _uniqueIdentity; - private System.DateTimeOffset _creationDateTime; - private System.DateTimeOffset? _modificationDateTime; - private System.DateTimeOffset? _deletedDateTime; + private System.DateTime _creationDateTime; + private System.DateTime? _modificationDateTime; + private System.DateTime? _deletedDateTime; private bool _isDeleted; private LanguageContract _language; @@ -4412,7 +4880,7 @@ public string UniqueIdentity } [Newtonsoft.Json.JsonProperty("creationDateTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset CreationDateTime + public System.DateTime CreationDateTime { get { return _creationDateTime; } @@ -4427,7 +4895,7 @@ public System.DateTimeOffset CreationDateTime } [Newtonsoft.Json.JsonProperty("modificationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ModificationDateTime + public System.DateTime? ModificationDateTime { get { return _modificationDateTime; } @@ -4442,7 +4910,7 @@ public System.DateTimeOffset? ModificationDateTime } [Newtonsoft.Json.JsonProperty("deletedDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? DeletedDateTime + public System.DateTime? DeletedDateTime { get { return _deletedDateTime; } @@ -5130,18 +5598,20 @@ public enum FailedReasonType public partial class FilterRequestContract : System.ComponentModel.INotifyPropertyChanged { private bool? _isDeleted; - private System.DateTimeOffset? _fromDeletedDateTime; - private System.DateTimeOffset? _toDeletedDateTime; - private System.DateTimeOffset? _fromCreationDateTime; - private System.DateTimeOffset? _toCreationDateTime; - private System.DateTimeOffset? _fromModificationDateTime; - private System.DateTimeOffset? _toModificationDateTime; + private System.DateTime? _fromDeletedDateTime; + private System.DateTime? _toDeletedDateTime; + private System.DateTime? _fromCreationDateTime; + private System.DateTime? _toCreationDateTime; + private System.DateTime? _fromModificationDateTime; + private System.DateTime? _toModificationDateTime; private string _uniqueIdentity; private GetUniqueIdentityType _uniqueIdentityType; private long? _index; private long? _length; - private string _sortColumnName; + private string _sortColumnNames; private bool _isDescending; + private string _text; + private string _language; [Newtonsoft.Json.JsonProperty("isDeleted", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool? IsDeleted @@ -5159,7 +5629,7 @@ public bool? IsDeleted } [Newtonsoft.Json.JsonProperty("fromDeletedDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? FromDeletedDateTime + public System.DateTime? FromDeletedDateTime { get { return _fromDeletedDateTime; } @@ -5174,7 +5644,7 @@ public System.DateTimeOffset? FromDeletedDateTime } [Newtonsoft.Json.JsonProperty("toDeletedDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ToDeletedDateTime + public System.DateTime? ToDeletedDateTime { get { return _toDeletedDateTime; } @@ -5189,7 +5659,7 @@ public System.DateTimeOffset? ToDeletedDateTime } [Newtonsoft.Json.JsonProperty("fromCreationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? FromCreationDateTime + public System.DateTime? FromCreationDateTime { get { return _fromCreationDateTime; } @@ -5204,7 +5674,7 @@ public System.DateTimeOffset? FromCreationDateTime } [Newtonsoft.Json.JsonProperty("toCreationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ToCreationDateTime + public System.DateTime? ToCreationDateTime { get { return _toCreationDateTime; } @@ -5219,7 +5689,7 @@ public System.DateTimeOffset? ToCreationDateTime } [Newtonsoft.Json.JsonProperty("fromModificationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? FromModificationDateTime + public System.DateTime? FromModificationDateTime { get { return _fromModificationDateTime; } @@ -5234,7 +5704,7 @@ public System.DateTimeOffset? FromModificationDateTime } [Newtonsoft.Json.JsonProperty("toModificationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ToModificationDateTime + public System.DateTime? ToModificationDateTime { get { return _toModificationDateTime; } @@ -5308,16 +5778,16 @@ public long? Length } } - [Newtonsoft.Json.JsonProperty("sortColumnName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string SortColumnName + [Newtonsoft.Json.JsonProperty("sortColumnNames", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string SortColumnNames { - get { return _sortColumnName; } + get { return _sortColumnNames; } set { - if (_sortColumnName != value) + if (_sortColumnNames != value) { - _sortColumnName = value; + _sortColumnNames = value; RaisePropertyChanged(); } } @@ -5338,6 +5808,36 @@ public bool IsDescending } } + [Newtonsoft.Json.JsonProperty("text", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Text + { + get { return _text; } + + set + { + if (_text != value) + { + _text = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("language", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Language + { + get { return _language; } + + set + { + if (_language != value) + { + _language = value; + RaisePropertyChanged(); + } + } + } + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) @@ -5866,9 +6366,9 @@ public partial class LanguageContract : System.ComponentModel.INotifyPropertyCha private long _id; private string _name; private string _uniqueIdentity; - private System.DateTimeOffset _creationDateTime; - private System.DateTimeOffset? _modificationDateTime; - private System.DateTimeOffset? _deletedDateTime; + private System.DateTime _creationDateTime; + private System.DateTime? _modificationDateTime; + private System.DateTime? _deletedDateTime; private bool _isDeleted; [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -5917,7 +6417,7 @@ public string UniqueIdentity } [Newtonsoft.Json.JsonProperty("creationDateTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset CreationDateTime + public System.DateTime CreationDateTime { get { return _creationDateTime; } @@ -5932,7 +6432,7 @@ public System.DateTimeOffset CreationDateTime } [Newtonsoft.Json.JsonProperty("modificationDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ModificationDateTime + public System.DateTime? ModificationDateTime { get { return _modificationDateTime; } @@ -5947,7 +6447,7 @@ public System.DateTimeOffset? ModificationDateTime } [Newtonsoft.Json.JsonProperty("deletedDateTime", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? DeletedDateTime + public System.DateTime? DeletedDateTime { get { return _deletedDateTime; } diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag index 1396817..ba75eda 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag @@ -10,7 +10,7 @@ }, "codeGenerators": { "openApiToCSharpClient": { - "clientBaseClass": null, + "clientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase", "configurationClass": null, "generateClientClasses": true, "generateClientInterfaces": false, @@ -23,7 +23,7 @@ "wrapDtoExceptions": true, "useHttpClientCreationMethod": false, "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, + "useHttpRequestMessageCreationMethod": true, "useBaseUrl": true, "generateBaseUrlProperty": true, "generateSyncMethods": false, @@ -57,10 +57,10 @@ "responseClass": "SwaggerResponse", "namespace": "Contents.GeneratedServices", "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", + "dateType": "System.DateTime", "jsonConverters": [], "anyType": "object", - "dateTimeType": "System.DateTimeOffset", + "dateTimeType": "System.DateTime", "timeType": "System.TimeSpan", "timeSpanType": "System.TimeSpan", "arrayType": "System.Collections.Generic.ICollection", @@ -78,7 +78,7 @@ "handleReferences": false, "generateImmutableArrayProperties": false, "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": "new EasyMicroservices.ContentsMicroservice.Clients.MyJsonSerializerSettings", + "jsonSerializerSettingsTransformationMethod": "new EasyMicroservices.Cores.Clients.CoreSerializerSettings", "inlineNamedArrays": false, "inlineNamedDictionaries": false, "inlineNamedTuples": true, diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag.json b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag.json index 1343318..a1a8881 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag.json +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Connected Services/ContentsGeneratedServices/OpenAPI.nswag.json @@ -201,6 +201,55 @@ } } }, + "/api/Category/UpdateChangedValuesOnly": { + "put": { + "tags": [ + "Category" + ], + "operationId": "UpdateChangedValuesOnly", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/CategoryContractMessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CategoryContractMessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CategoryContractMessageContract" + } + } + } + } + } + } + }, "/api/Category/UpdateBulk": { "put": { "tags": [ @@ -250,6 +299,55 @@ } } }, + "/api/Category/UpdateBulkChangedValuesOnly": { + "put": { + "tags": [ + "Category" + ], + "operationId": "UpdateBulkChangedValuesOnly", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContractUpdateBulkRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContractUpdateBulkRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateCategoryRequestContractUpdateBulkRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + } + } + } + } + } + }, "/api/Category/HardDeleteById": { "delete": { "tags": [ @@ -1015,6 +1113,55 @@ } } }, + "/api/Content/UpdateChangedValuesOnly": { + "put": { + "tags": [ + "Content" + ], + "operationId": "UpdateChangedValuesOnly2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ContentContractMessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentContractMessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ContentContractMessageContract" + } + } + } + } + } + } + }, "/api/Content/UpdateBulk": { "put": { "tags": [ @@ -1064,6 +1211,55 @@ } } }, + "/api/Content/UpdateBulkChangedValuesOnly": { + "put": { + "tags": [ + "Content" + ], + "operationId": "UpdateBulkChangedValuesOnly2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContractUpdateBulkRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContractUpdateBulkRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateContentRequestContractUpdateBulkRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + } + } + } + } + } + }, "/api/Content/HardDeleteById": { "delete": { "tags": [ @@ -1682,6 +1878,55 @@ } } }, + "/api/Language/UpdateChangedValuesOnly": { + "put": { + "tags": [ + "Language" + ], + "operationId": "UpdateChangedValuesOnly3", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/LanguageContractMessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/LanguageContractMessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/LanguageContractMessageContract" + } + } + } + } + } + } + }, "/api/Language/UpdateBulk": { "put": { "tags": [ @@ -1731,6 +1976,55 @@ } } }, + "/api/Language/UpdateBulkChangedValuesOnly": { + "put": { + "tags": [ + "Language" + ], + "operationId": "UpdateBulkChangedValuesOnly3", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContractUpdateBulkRequestContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContractUpdateBulkRequestContract" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/UpdateLanguageRequestContractUpdateBulkRequestContract" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/MessageContract" + } + } + } + } + } + } + }, "/api/Language/HardDeleteById": { "delete": { "tags": [ @@ -2622,12 +2916,20 @@ "format": "int64", "nullable": true }, - "sortColumnName": { + "sortColumnNames": { "type": "string", "nullable": true }, "isDescending": { "type": "boolean" + }, + "text": { + "type": "string", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true } } }, diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj index c647ba6..6167344 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.18 + 0.0.0.19 client generated code. EasyMicroservices@gmail.com microservice,Content,Contents,client @@ -16,7 +16,8 @@ - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/SafeContractResolver.cs b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/SafeContractResolver.cs deleted file mode 100644 index 0525a08..0000000 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/SafeContractResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using System.Reflection; - -namespace EasyMicroservices.ContentsMicroservice.Clients -{ - internal class SafeContractResolver : DefaultContractResolver - { - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - var jsonProp = base.CreateProperty(member, memberSerialization); - jsonProp.Required = Required.Default; - return jsonProp; - } - } - - internal class MyJsonSerializerSettings : JsonSerializerSettings - { - public MyJsonSerializerSettings(JsonSerializerSettings settings) - { - this.ContractResolver = new SafeContractResolver(); - } - } -}