Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more log and update packages #42

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.22</Version>
<Version>0.0.0.23</Version>
<Description>client generated code.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>microservice,Content,Contents,client</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,25 @@ async Task<CategoryContractMessageContract> 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<MessageContract> SaveToContentLanguageUpdate(object item, Func<(string UniqueIdentity, string Name, IEnumerable<LanguageDataContract> Languages)[], Task<MessageContract>> saveData)
{
Expand All @@ -273,7 +285,10 @@ async Task<MessageContract> SaveToContentLanguageUpdate(object item, Func<(strin
}
var result = await saveData(request.ToArray());
if (!result.IsSuccess)
{
LogContract(result.Error);
return result;
}
return new MessageContract()
{
IsSuccess = true,
Expand Down Expand Up @@ -350,7 +365,10 @@ async Task<CategoryContractMessageContract> AddToContent(params (string UniqueId
{
result = await AddToContent(item.UniqueIdentity, item.Name, item.Languages);
if (!result.IsSuccess)
{
LogContract(result.Error);
return result;
}
}
return result;
}
Expand Down Expand Up @@ -390,7 +408,10 @@ async Task<MessageContract> UpdateToContent(params (string UniqueIdentity, strin
{
result = await UpdateToContent(item.UniqueIdentity, item.Name, item.Languages);
if (!result.IsSuccess)
{
LogContract(result.Error);
return result;
}
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="EasyMicroservices.Configuration" Version="*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.0.76" />
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.1.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.15" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.ContentsMicroservice.Clients" Version="0.0.0.21" />
<PackageReference Include="EasyMicroservices.ContentsMicroservice.Clients" Version="0.0.0.22" />
<PackageReference Include="EasyMicroservices.Tests" Version="*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand All @@ -32,7 +32,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing">
<Version>7.0.14</Version>
<Version>7.0.15</Version>
</PackageReference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.14">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public static async Task Main(string[] args)
static WebApplicationBuilder CreateBuilder(string[] args)
{
var app = StartUpExtensions.Create<ContentContext>(args);
app.Services.Builder<ContentContext>("Content");
app.Services.Builder<ContentContext>("Content")
.UseDefaultSwaggerOptions();
app.Services.AddTransient((serviceProvider) => new UnitOfWork(serviceProvider));
app.Services.AddTransient(serviceProvider => new ContentContext(serviceProvider.GetService<IEntityFrameworkCoreDatabaseBuilder>()));
app.Services.AddTransient<IEntityFrameworkCoreDatabaseBuilder, DatabaseBuilder>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading