Update Lang Version to 12 ...
Add Support for Get all As Async Enumerable ...
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
@@ -271,6 +272,44 @@ namespace xPushService.Base
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// retrieve all exists Dtos
|
||||||
|
/// as Async Enumerable ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ignoreSoftDeleteds"></param>
|
||||||
|
/// <param name="orderBuilder"></param>
|
||||||
|
/// <param name="includeBuilder"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public virtual async IAsyncEnumerable<TDto> GetAllAsAsyncEnumerable(
|
||||||
|
bool ignoreSoftDeleteds = true,
|
||||||
|
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBuilder = null,
|
||||||
|
Func<IQueryable<TEntity>, IIncludableQueryable<TEntity, object>> includeBuilder = null,
|
||||||
|
[EnumeratorCancellation] CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var enumerable = Service.GetAllAsAsyncEnumerable(
|
||||||
|
orderBuilder: orderBuilder,
|
||||||
|
includeBuilder: includeBuilder,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
ignoreSoftDeleteds: ignoreSoftDeleteds
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
await foreach (var dto in enumerable)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (cancellationToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
yield return dto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// find an Item by providing a Conditional Expression ...
|
/// find an Item by providing a Conditional Expression ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -133,6 +133,22 @@ namespace xPushService.Interfaces
|
|||||||
CancellationToken cancellationToken = default
|
CancellationToken cancellationToken = default
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// retrieve all exists Dtos
|
||||||
|
/// as Async Enumerable ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ignoreSoftDeleteds"></param>
|
||||||
|
/// <param name="orderBuilder"></param>
|
||||||
|
/// <param name="includeBuilder"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IAsyncEnumerable<TDto> GetAllAsAsyncEnumerable(
|
||||||
|
bool ignoreSoftDeleteds = true,
|
||||||
|
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBuilder = null,
|
||||||
|
Func<IQueryable<TEntity>, IIncludableQueryable<TEntity, object>> includeBuilder = null,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// find an Item by providing a Conditional Expression ...
|
/// find an Item by providing a Conditional Expression ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
+2
-1
@@ -2,11 +2,12 @@
|
|||||||
<!-- Runtime Definition -->
|
<!-- Runtime Definition -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<LangVersion>8.0</LangVersion>
|
<LangVersion>12.0</LangVersion>
|
||||||
<Authors>Hadi Khazaee Asl</Authors>
|
<Authors>Hadi Khazaee Asl</Authors>
|
||||||
<Company>SaherElm IT Center</Company>
|
<Company>SaherElm IT Center</Company>
|
||||||
<PackageId>xDashboard.xPushService</PackageId>
|
<PackageId>xDashboard.xPushService</PackageId>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
|
||||||
<Description>
|
<Description>
|
||||||
it is a Part of xDashboard Projects on SaherElm IT Center which provides all required models
|
it is a Part of xDashboard Projects on SaherElm IT Center which provides all required models
|
||||||
and actions in related to
|
and actions in related to
|
||||||
|
|||||||
Reference in New Issue
Block a user