Skip to content

Commit

Permalink
Merge pull request #97 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
rename some contracts
  • Loading branch information
Ali-YousefiTelori authored Dec 17, 2023
2 parents a0ab098 + ebecead commit 44d3db5
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 63 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.65</Version>
<Version>0.0.0.66</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 @@ -23,7 +23,7 @@ namespace EasyMicroservices.Cores.AspCoreApi;
[ApiController]
[Route("api/[controller]/[action]")]
public class MultilingualReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TLanguageResponseContract, TId> :
ControllerBase, IReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TId, IdLanguageRequestContract<TId>, UniqueIdentityLanguageRequestContract>
ControllerBase, IReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TId, GetByIdLanguageRequestContract<TId>, GetByUniqueIdentityLanguageRequestContract>
where TResponseContract : class
where TLanguageResponseContract : class
where TEntity : class
Expand Down Expand Up @@ -104,7 +104,7 @@ async Task<MessageContract<TLanguageResponseContract>> ResolveContentAllLanguage
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<MessageContract<TResponseContract>> GetById(IdLanguageRequestContract<TId> request, CancellationToken cancellationToken = default)
public virtual async Task<MessageContract<TResponseContract>> GetById(GetByIdLanguageRequestContract<TId> request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetById(request, OnGetQuery(), cancellationToken);
return await ResolveContentLanguage(result, request.LanguageShortName);
Expand All @@ -117,7 +117,7 @@ public virtual async Task<MessageContract<TResponseContract>> GetById(IdLanguage
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> GetByIdAllLanguage(IdRequestContract<TId> request, CancellationToken cancellationToken = default)
public async Task<MessageContract<TLanguageResponseContract>> GetByIdAllLanguage(GetByIdRequestContract<TId> request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetById(request, OnGetQuery(), cancellationToken);
return await ResolveContentAllLanguage(result);
Expand All @@ -130,7 +130,7 @@ public async Task<MessageContract<TLanguageResponseContract>> GetByIdAllLanguage
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<MessageContract<TResponseContract>> GetByUniqueIdentity(UniqueIdentityLanguageRequestContract request, CancellationToken cancellationToken = default)
public virtual async Task<MessageContract<TResponseContract>> GetByUniqueIdentity(GetByUniqueIdentityLanguageRequestContract request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetByUniqueIdentity(request, request.Type, OnGetQuery(), cancellationToken);
return await ResolveContentLanguage(result, request.LanguageShortName);
Expand All @@ -143,7 +143,7 @@ public virtual async Task<MessageContract<TResponseContract>> GetByUniqueIdentit
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> GetByUniqueIdentityAllLanguage(UniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
public async Task<MessageContract<TLanguageResponseContract>> GetByUniqueIdentityAllLanguage(GetByUniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetByUniqueIdentity(request, request.Type, OnGetQuery(), cancellationToken);
return await ResolveContentAllLanguage(result);
Expand Down Expand Up @@ -206,7 +206,7 @@ public async Task<MessageContract<TLanguageResponseContract>> GetAllWithAllLangu
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<ListMessageContract<TResponseContract>> GetAllByUniqueIdentity(UniqueIdentityLanguageRequestContract request, CancellationToken cancellationToken = default)
public virtual async Task<ListMessageContract<TResponseContract>> GetAllByUniqueIdentity(GetByUniqueIdentityLanguageRequestContract request, CancellationToken cancellationToken = default)
{
var result = await ContractLogic.GetAllByUniqueIdentity(request, request.Type, OnGetAllQuery(), cancellationToken);
return await ResolveContentLanguage(result, request.LanguageShortName);
Expand All @@ -218,7 +218,7 @@ public virtual async Task<ListMessageContract<TResponseContract>> GetAllByUnique
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<MessageContract<TLanguageResponseContract>> GetAllByUniqueIdentityAllLanguage(UniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
public async Task<MessageContract<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 @@ -80,7 +80,7 @@ async Task<MessageContract<TId>> AddToContentLanguage(MessageContract<TId> messa
if (!messageContract)
return messageContract;
var contentResolver = UnitOfWork.GetContentResolver();
var addedItem = await GetById(new Contracts.Requests.Multilingual.IdLanguageRequestContract<TId> { Id = messageContract })
var addedItem = await GetById(new Contracts.Requests.Multilingual.GetByIdLanguageRequestContract<TId> { Id = messageContract })
.AsCheckedResult();
foreach (var request in requests)
{
Expand All @@ -97,7 +97,7 @@ async Task<ListMessageContract<TId>> AddToContentLanguage(ListMessageContract<TI
var contentResolver = UnitOfWork.GetContentResolver();
foreach (var item in messageContract.Result)
{
var addedItem = await GetById(new Contracts.Requests.Multilingual.IdLanguageRequestContract<TId> { Id = item })
var addedItem = await GetById(new Contracts.Requests.Multilingual.GetByIdLanguageRequestContract<TId> { Id = item })
.AsCheckedResult();
foreach (var request in requests)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace EasyMicroservices.Cores.AspCoreApi
[ApiController]
[Route("api/[controller]/[action]")]
public class ReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TId> :
ControllerBase, IReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TId, IdRequestContract<TId>, UniqueIdentityRequestContract>
ControllerBase, IReadableQueryServiceController<TEntity, TFilterContract, TResponseContract, TId, GetByIdRequestContract<TId>, GetByUniqueIdentityRequestContract>
where TResponseContract : class
where TEntity : class
where TFilterContract : FilterRequestContract
Expand Down Expand Up @@ -71,7 +71,7 @@ public ReadableQueryServiceController(IBaseUnitOfWork unitOfWork)
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual Task<MessageContract<TResponseContract>> GetById(IdRequestContract<TId> request, CancellationToken cancellationToken = default)
public virtual Task<MessageContract<TResponseContract>> GetById(GetByIdRequestContract<TId> request, CancellationToken cancellationToken = default)
{
return ContractLogic.GetById(request, OnGetQuery(), cancellationToken);
}
Expand All @@ -83,7 +83,7 @@ public virtual Task<MessageContract<TResponseContract>> GetById(IdRequestContrac
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual Task<MessageContract<TResponseContract>> GetByUniqueIdentity(UniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
public virtual Task<MessageContract<TResponseContract>> GetByUniqueIdentity(GetByUniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
{
return ContractLogic.GetByUniqueIdentity(request, request.Type, OnGetQuery(), cancellationToken);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public virtual Task<ListMessageContract<TResponseContract>> GetAll(CancellationT
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public virtual Task<ListMessageContract<TResponseContract>> GetAllByUniqueIdentity(UniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
public virtual Task<ListMessageContract<TResponseContract>> GetAllByUniqueIdentity(GetByUniqueIdentityRequestContract request, CancellationToken cancellationToken = default)
{
return ContractLogic.GetAllByUniqueIdentity(request, request.Type, OnGetAllQuery(), cancellationToken);
}
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.65</Version>
<Version>0.0.0.66</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.65</Version>
<Version>0.0.0.66</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
Expand Up @@ -6,7 +6,7 @@ namespace EasyMicroservices.Cores.Contracts.Requests
///
/// </summary>
/// <typeparam name="T"></typeparam>
public class IdRequestContract<T> : IIdSchema<T>
public class GetByIdRequestContract<T> : IIdSchema<T>
{
/// <summary>
///
Expand All @@ -16,9 +16,9 @@ public class IdRequestContract<T> : IIdSchema<T>
///
/// </summary>
/// <param name="id"></param>
public static implicit operator IdRequestContract<T>(T id)
public static implicit operator GetByIdRequestContract<T>(T id)
{
return new IdRequestContract<T>()
return new GetByIdRequestContract<T>()
{
Id = id
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace EasyMicroservices.Cores.Contracts.Requests
/// <summary>
///
/// </summary>
public class UniqueIdentityRequestContract : IUniqueIdentitySchema
public class GetByUniqueIdentityRequestContract : IUniqueIdentitySchema
{
/// <summary>
///
Expand All @@ -21,9 +21,9 @@ public class UniqueIdentityRequestContract : IUniqueIdentitySchema
///
/// </summary>
/// <param name="uniqueIdentity"></param>
public static implicit operator UniqueIdentityRequestContract(string uniqueIdentity)
public static implicit operator GetByUniqueIdentityRequestContract(string uniqueIdentity)
{
return new UniqueIdentityRequestContract()
return new GetByUniqueIdentityRequestContract()
{
UniqueIdentity = uniqueIdentity
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// </summary>
/// <typeparam name="T"></typeparam>
public class IdLanguageRequestContract<T> : IdRequestContract<T>
public class GetByIdLanguageRequestContract<T> : GetByIdRequestContract<T>
{
/// <summary>
///
Expand All @@ -13,9 +13,9 @@ public class IdLanguageRequestContract<T> : IdRequestContract<T>
///
/// </summary>
/// <param name="id"></param>
public static implicit operator IdLanguageRequestContract<T>(T id)
public static implicit operator GetByIdLanguageRequestContract<T>(T id)
{
return new IdLanguageRequestContract<T>()
return new GetByIdLanguageRequestContract<T>()
{
Id = id
};
Expand All @@ -25,9 +25,9 @@ public static implicit operator IdLanguageRequestContract<T>(T id)
///
/// </summary>
/// <param name="input"></param>
public static implicit operator IdLanguageRequestContract<T>((T Id, string LanguageShortName) input)
public static implicit operator GetByIdLanguageRequestContract<T>((T Id, string LanguageShortName) input)
{
return new IdLanguageRequestContract<T>()
return new GetByIdLanguageRequestContract<T>()
{
Id = input.Id,
LanguageShortName = input.LanguageShortName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// <summary>
///
/// </summary>
public class UniqueIdentityLanguageRequestContract : UniqueIdentityRequestContract
public class GetByUniqueIdentityLanguageRequestContract : GetByUniqueIdentityRequestContract
{
/// <summary>
///
Expand All @@ -13,9 +13,9 @@ public class UniqueIdentityLanguageRequestContract : UniqueIdentityRequestContra
///
/// </summary>
/// <param name="uniqueIdentity"></param>
public static implicit operator UniqueIdentityLanguageRequestContract(string uniqueIdentity)
public static implicit operator GetByUniqueIdentityLanguageRequestContract(string uniqueIdentity)
{
return new UniqueIdentityLanguageRequestContract()
return new GetByUniqueIdentityLanguageRequestContract()
{
UniqueIdentity = uniqueIdentity
};
Expand All @@ -25,9 +25,9 @@ public static implicit operator UniqueIdentityLanguageRequestContract(string uni
///
/// </summary>
/// <param name="input"></param>
public static implicit operator UniqueIdentityLanguageRequestContract((string UniqueIdentity, string LanguageShortName) input)
public static implicit operator GetByUniqueIdentityLanguageRequestContract((string UniqueIdentity, string LanguageShortName) input)
{
return new UniqueIdentityLanguageRequestContract()
return new GetByUniqueIdentityLanguageRequestContract()
{
UniqueIdentity = input.UniqueIdentity,
LanguageShortName = input.LanguageShortName
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.65</Version>
<Version>0.0.0.66</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 @@ -24,7 +24,7 @@ public interface IReadableLogic<TResultSchema, TId>
/// <param name="idRequest"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<MessageContract<TResultSchema>> GetById(IdRequestContract<TId> idRequest, CancellationToken cancellationToken = default);
Task<MessageContract<TResultSchema>> GetById(GetByIdRequestContract<TId> idRequest, CancellationToken cancellationToken = default);
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -64,7 +64,7 @@ public interface IContractReadableLogic<TEntity, TContract, TId> : IReadableLogi
/// <param name="query"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<MessageContract<TContract>> GetById(IdRequestContract<TId> idRequest, Func<IQueryable<TEntity>, IQueryable<TEntity>> query = default, CancellationToken cancellationToken = default);
Task<MessageContract<TContract>> GetById(GetByIdRequestContract<TId> idRequest, Func<IQueryable<TEntity>, IQueryable<TEntity>> query = default, CancellationToken cancellationToken = default);
/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public DatabaseLogicBase(IEasyReadableQueryableAsync<TEntity> easyReadableQuerya
/// <param name="idRequest"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<MessageContract<TEntity>> GetById(IdRequestContract<TId> idRequest, CancellationToken cancellationToken = default)
public async Task<MessageContract<TEntity>> GetById(GetByIdRequestContract<TId> idRequest, CancellationToken cancellationToken = default)
{
return await GetById(_easyReadableQueryable, idRequest, null, cancellationToken);
}
Expand All @@ -73,7 +73,7 @@ public async Task<MessageContract<TEntity>> GetById(IdRequestContract<TId> idReq
/// <param name="query"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<MessageContract<TEntity>> GetById(IdRequestContract<TId> idRequest, Func<IQueryable<TEntity>, IQueryable<TEntity>> query = default, CancellationToken cancellationToken = default)
public async Task<MessageContract<TEntity>> GetById(GetByIdRequestContract<TId> idRequest, Func<IQueryable<TEntity>, IQueryable<TEntity>> query = default, CancellationToken cancellationToken = default)
{
Func<IEasyReadableQueryableAsync<TEntity>, IEasyReadableQueryableAsync<TEntity>> func = null;
if (query != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async Task<IEasyReadableQueryableAsync<TEntity>> UniqueIdentityQueryMake
/// <param name="query"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected async Task<MessageContract<TEntity>> GetById<TEntity, TId>(IEasyReadableQueryableAsync<TEntity> easyReadableQueryable, IdRequestContract<TId> idRequest, Func<IEasyReadableQueryableAsync<TEntity>, IEasyReadableQueryableAsync<TEntity>> query = default, CancellationToken cancellationToken = default)
protected async Task<MessageContract<TEntity>> GetById<TEntity, TId>(IEasyReadableQueryableAsync<TEntity> easyReadableQueryable, GetByIdRequestContract<TId> idRequest, Func<IEasyReadableQueryableAsync<TEntity>, IEasyReadableQueryableAsync<TEntity>> query = default, CancellationToken cancellationToken = default)
where TEntity : class
{
IEasyReadableQueryableAsync<TEntity> queryable = easyReadableQueryable;
Expand Down Expand Up @@ -230,7 +230,7 @@ public async Task<MessageContract<TContract>> GetBy<TEntity, TContract>(IEasyRea
/// <param name="query"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected async Task<MessageContract<TContract>> GetById<TEntity, TContract, TId>(IEasyReadableQueryableAsync<TEntity> easyReadableQueryable, IdRequestContract<TId> idRequest, Func<IEasyReadableQueryableAsync<TEntity>, IEasyReadableQueryableAsync<TEntity>> query = default, CancellationToken cancellationToken = default)
protected async Task<MessageContract<TContract>> GetById<TEntity, TContract, TId>(IEasyReadableQueryableAsync<TEntity> easyReadableQueryable, GetByIdRequestContract<TId> idRequest, Func<IEasyReadableQueryableAsync<TEntity>, IEasyReadableQueryableAsync<TEntity>> query = default, CancellationToken cancellationToken = default)
where TEntity : class
where TContract : class
{
Expand Down
Loading

0 comments on commit 44d3db5

Please sign in to comment.