Skip to content

Commit

Permalink
update packages and fix some methods in multiple language requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Dec 24, 2023
1 parent 720edf0 commit c03ca66
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>asp core servces.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,services,asp,aspnet</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ async Task<MessageContract<TLanguageResponseContract>> ResolveContentAllLanguage
return mapped;
}

async Task<ListMessageContract<TLanguageResponseContract>> ResolveContentAllLanguage<T>(ListMessageContract<T> result)
{
if (!result)
return result.ToListContract<TLanguageResponseContract>();
var contentResolver = UnitOfWork.GetContentResolver();
var mapper = UnitOfWork.GetMapper();
var mapped = mapper.MapToList<TLanguageResponseContract>(result.Result);
await contentResolver.ResolveContentAllLanguage(mapped);
return mapped;
}

/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -169,7 +180,7 @@ public virtual async Task<ListMessageContract<TResponseContract>> Filter(TFilter
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> FilterAllLanguage(TFilterContract filterRequest, CancellationToken cancellationToken = default)
public async Task<ListMessageContract<TLanguageResponseContract>> FilterAllLanguage(TFilterContract filterRequest, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.Filter(filterRequest, OnGetAllQuery(), cancellationToken);
return await ResolveContentAllLanguage(result);
Expand All @@ -187,13 +198,26 @@ public virtual async Task<ListMessageContract<TResponseContract>> GetAll(Cancell
return await ResolveContentLanguage(result, default);
}

/// <summary>
///
/// </summary>
/// <param name="getByLanguageRequest"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<ListMessageContract<TResponseContract>> GetAllByLanguage(GetByLanguageRequestContract getByLanguageRequest, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetAll(OnGetAllQuery(), cancellationToken);
return await ResolveContentLanguage(result, getByLanguageRequest.LanguageShortName);
}

/// <summary>
///
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> GetAllWithAllLanguage(CancellationToken cancellationToken = default)
public async Task<ListMessageContract<TLanguageResponseContract>> GetAllWithAllLanguage(CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetAll(OnGetAllQuery(), cancellationToken);
return await ResolveContentAllLanguage(result);
Expand All @@ -218,7 +242,7 @@ public virtual async Task<ListMessageContract<TResponseContract>> GetAllByUnique
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> GetAllByUniqueIdentityAllLanguage(GetByUniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
public async Task<ListMessageContract<TLanguageResponseContract>> GetAllByUniqueIdentityAllLanguage(GetByUniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetAllByUniqueIdentity(request, request.Type, OnGetAllQuery(), cancellationToken);
return await ResolveContentAllLanguage(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>asp core servces.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,services,asp,aspnet,aspcore,efcore</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>core of database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,client,clients</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace EasyMicroservices.Cores.Contracts.Requests.Multilingual;
/// <summary>
///
/// </summary>
public class GetByLanguageRequestContract
{
/// <summary>
///
/// </summary>
public string LanguageShortName { get; set; }
/// <summary>
///
/// </summary>
/// <param name="languageShortName"></param>
public static implicit operator GetByLanguageRequestContract(string languageShortName)
{
return new GetByLanguageRequestContract()
{
LanguageShortName = languageShortName
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net45;net6.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>core contracts.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,contract,contracts,dto,dtos</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net45;net6.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>core of database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>ef core of database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,ef,efcore</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<Version>0.0.0.70</Version>
<Version>0.0.0.71</Version>
<Description>ef core of Relational database.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>core,cores,base,database,ef,efcore,Relational</PackageTags>
Expand Down

0 comments on commit c03ca66

Please sign in to comment.