feat(QueryExtensions): add combined EnvelopeReceiver query support in QueryExtensions
This commit is contained in:
parent
ad032b2bdf
commit
783d91a658
@ -37,13 +37,12 @@ public static class QueryExtensions
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TEntity"></typeparam>
|
/// <typeparam name="TEntity"></typeparam>
|
||||||
/// <typeparam name="TReceiverQueryBase"></typeparam>
|
|
||||||
/// <param name="root"></param>
|
/// <param name="root"></param>
|
||||||
/// <param name="query"></param>
|
/// <param name="query"></param>
|
||||||
/// <param name="notnull"></param>
|
/// <param name="notnull"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="BadRequestException"></exception>
|
/// <exception cref="BadRequestException"></exception>
|
||||||
public static IQueryable<TEntity> Where<TEntity, TReceiverQueryBase>(this IQueryable<TEntity> root, ReceiverQueryBase query, bool notnull = true)
|
public static IQueryable<TEntity> Where<TEntity>(this IQueryable<TEntity> root, ReceiverQueryBase query, bool notnull = true)
|
||||||
where TEntity : IHasReceiver
|
where TEntity : IHasReceiver
|
||||||
{
|
{
|
||||||
if (query.Id is not null)
|
if (query.Id is not null)
|
||||||
@ -59,4 +58,20 @@ public static class QueryExtensions
|
|||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TEntity"></typeparam>
|
||||||
|
/// <typeparam name="TEnvelopeQuery"></typeparam>
|
||||||
|
/// <typeparam name="TReceiverQuery"></typeparam>
|
||||||
|
/// <param name="root"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="notnull"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static IQueryable<TEntity> Where<TEntity, TEnvelopeQuery, TReceiverQuery>(this IQueryable<TEntity> root, EnvelopeReceiverQueryBase<TEnvelopeQuery, TReceiverQuery> query, bool notnull = true)
|
||||||
|
where TEntity : IHasEnvelope, IHasReceiver
|
||||||
|
where TEnvelopeQuery : EnvelopeQueryBase, new()
|
||||||
|
where TReceiverQuery : ReceiverQueryBase, new()
|
||||||
|
=> root.Where(query.Envelope, notnull).Where(query.Receiver, notnull);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user