Skip to content

Commit

Permalink
Merge pull request #42 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
Add more log and update packages
  • Loading branch information
Ali-YousefiTelori authored Jan 30, 2024
2 parents 603a606 + 6aba0bf commit 8fa8b92
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 9 deletions.
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

0 comments on commit 8fa8b92

Please sign in to comment.