diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/EasyMicroservices.ContentsMicroservice.Clients.csproj index c556dbc..72c0487 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.22 + 0.0.0.23 client generated code. EasyMicroservices@gmail.com microservice,Content,Contents,client diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Helpers/ContentLanguageHelper.cs b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Helpers/ContentLanguageHelper.cs index 98a70a2..b521fd5 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Helpers/ContentLanguageHelper.cs +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Clients/Helpers/ContentLanguageHelper.cs @@ -240,13 +240,25 @@ async Task SaveToContentLanguage(object item, F } var result = await saveData(request.ToArray()); if (!result.IsSuccess) + { + LogContract(result.Error); return result; + } + return new CategoryContractMessageContract() { IsSuccess = true, }; } + void LogContract(ErrorContract contract) + { + Console.WriteLine($"Content Error Message: {contract.Message}"); + Console.WriteLine($"Content Error EndUserMessage: {contract.EndUserMessage}"); + Console.WriteLine($"Content Error Details: {contract.Details}"); + Console.WriteLine($"Content Error ProjectName: {contract.ServiceDetails?.ProjectName}"); + Console.WriteLine($"Content Error MethodName: {contract.ServiceDetails?.MethodName}"); + } async Task SaveToContentLanguageUpdate(object item, Func<(string UniqueIdentity, string Name, IEnumerable Languages)[], Task> saveData) { @@ -273,7 +285,10 @@ async Task SaveToContentLanguageUpdate(object item, Func<(strin } var result = await saveData(request.ToArray()); if (!result.IsSuccess) + { + LogContract(result.Error); return result; + } return new MessageContract() { IsSuccess = true, @@ -350,7 +365,10 @@ async Task AddToContent(params (string UniqueId { result = await AddToContent(item.UniqueIdentity, item.Name, item.Languages); if (!result.IsSuccess) + { + LogContract(result.Error); return result; + } } return result; } @@ -390,7 +408,10 @@ async Task UpdateToContent(params (string UniqueIdentity, strin { result = await UpdateToContent(item.UniqueIdentity, item.Name, item.Languages); if (!result.IsSuccess) + { + LogContract(result.Error); return result; + } } return result; } diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Database/EasyMicroservices.ContentsMicroservice.Database.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.Database/EasyMicroservices.ContentsMicroservice.Database.csproj index 0621a7f..ba719bf 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Database/EasyMicroservices.ContentsMicroservice.Database.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Database/EasyMicroservices.ContentsMicroservice.Database.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Domain/EasyMicroservices.ContentsMicroservice.Domain.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.Domain/EasyMicroservices.ContentsMicroservice.Domain.csproj index 1ab11f7..b042368 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Domain/EasyMicroservices.ContentsMicroservice.Domain.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Domain/EasyMicroservices.ContentsMicroservice.Domain.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.StartUp/EasyMicroservices.ContentsMicroservice.StartUp.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.StartUp/EasyMicroservices.ContentsMicroservice.StartUp.csproj index 3b2f750..1feff5c 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.StartUp/EasyMicroservices.ContentsMicroservice.StartUp.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.StartUp/EasyMicroservices.ContentsMicroservice.StartUp.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.Tests/EasyMicroservices.ContentsMicroservice.Tests.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.Tests/EasyMicroservices.ContentsMicroservice.Tests.csproj index 57c83ed..e587789 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.Tests/EasyMicroservices.ContentsMicroservice.Tests.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.Tests/EasyMicroservices.ContentsMicroservice.Tests.csproj @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ all - 7.0.14 + 7.0.15 diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/EasyMicroservices.ContentsMicroservice.WebApi.csproj b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/EasyMicroservices.ContentsMicroservice.WebApi.csproj index 20453b0..848ce47 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/EasyMicroservices.ContentsMicroservice.WebApi.csproj +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/EasyMicroservices.ContentsMicroservice.WebApi.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/Program.cs b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/Program.cs index cd54dd1..97c0b55 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/Program.cs +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/Program.cs @@ -17,7 +17,8 @@ public static async Task Main(string[] args) static WebApplicationBuilder CreateBuilder(string[] args) { var app = StartUpExtensions.Create(args); - app.Services.Builder("Content"); + app.Services.Builder("Content") + .UseDefaultSwaggerOptions(); app.Services.AddTransient((serviceProvider) => new UnitOfWork(serviceProvider)); app.Services.AddTransient(serviceProvider => new ContentContext(serviceProvider.GetService())); app.Services.AddTransient(); diff --git a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/appsettings.json b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/appsettings.json index 8e58937..6fa87ab 100644 --- a/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/appsettings.json +++ b/src/CSharp/EasyMicroservices.ContentsMicroservice.WebApi/appsettings.json @@ -26,12 +26,20 @@ } ], "Authorization": { - "Use": true, + "IsUse": false, "JWT": { "Key": "VGhpc0lzGHGHGHlY3JldEtleUZvckp3dEF1dGhlbnRpY2F0aW9u=", "Issuer": "https://github.com/easymicroservices", "Audience": "easymicroservices", + "TokenExpireTimeInSeconds": 86400 + }, + "FullAccessPAT": "ownerpat" + }, + "Swagger": { + "IsUse": true, + "SwaggerUI": { + "Endpoints": [] } }, "Urls": "http://*:2003"