Update Lang Version to 12 ...

Add Support for Get All as Async Enumerable ...
This commit is contained in:
2026-06-12 02:13:10 +03:30
parent b4d8484f4c
commit 3ff20403f9
5 changed files with 57 additions and 0 deletions
+1
View File
@@ -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.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Query;
+17
View File
@@ -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 AutoMapper; using AutoMapper;
@@ -227,6 +228,22 @@ namespace xDataService.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 Dto by providing a Conditional Expression ... /// find an Dto by providing a Conditional Expression ...
/// </summary> /// </summary>
+1
View File
@@ -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.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
+37
View File
@@ -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 AutoMapper; using AutoMapper;
@@ -613,6 +614,42 @@ namespace xDataService.Providers
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 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 entityEnumerable = Repository.GetAllAsAsyncEnumerable(
orderBuilder: orderBuilder,
includeBuilder: includeBuilder,
ignoreSoftDeleteds: ignoreSoftDeleteds
);
await foreach (var entity in entityEnumerable)
{
//
if (cancellationToken.IsCancellationRequested)
{
yield break;
}
//
var dto = Mapper.Map<TDto>(entity);
yield return dto;
}
}
/// <summary> /// <summary>
/// find an Dto by providing a Conditional Expression ... /// find an Dto by providing a Conditional Expression ...
/// </summary> /// </summary>
+1
View File
@@ -7,6 +7,7 @@
<Company>SaherElm IT Center</Company> <Company>SaherElm IT Center</Company>
<PackageId>xDashboard.xDataService</PackageId> <PackageId>xDashboard.xDataService</PackageId>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<Description> <Description>
provide base requiremennts for Repository DataBase using and tools for using in xDashboard provide base requiremennts for Repository DataBase using and tools for using in xDashboard
project. project.