diff --git a/eng/packages/General.props b/eng/packages/General.props index 503e2c1c321..81c29dabff3 100644 --- a/eng/packages/General.props +++ b/eng/packages/General.props @@ -32,6 +32,7 @@ + diff --git a/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj b/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj index b7515183a86..8df401df7fd 100644 --- a/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj +++ b/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj @@ -28,4 +28,8 @@ + + + + diff --git a/src/Libraries/Microsoft.Extensions.DataIngestion/Utils/Batching.cs b/src/Libraries/Microsoft.Extensions.DataIngestion/Utils/Batching.cs index b210019401b..a3ec04ab088 100644 --- a/src/Libraries/Microsoft.Extensions.DataIngestion/Utils/Batching.cs +++ b/src/Libraries/Microsoft.Extensions.DataIngestion/Utils/Batching.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; -#if NET10_0_OR_GREATER using System.Linq; -#endif using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; @@ -69,40 +67,4 @@ internal static async IAsyncEnumerable> ProcessAsync Chunk(this IAsyncEnumerable source, int count) -#pragma warning restore VSTHRD200 // Use "Async" suffix for async methods - { - _ = Throw.IfNull(source); - _ = Throw.IfLessThanOrEqual(count, 0); - - return CoreAsync(source, count); - - static async IAsyncEnumerable CoreAsync(IAsyncEnumerable source, int count, - [EnumeratorCancellation] CancellationToken cancellationToken = default) - { - var buffer = new TSource[count]; - int index = 0; - - await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) - { - buffer[index++] = item; - - if (index == count) - { - index = 0; - yield return buffer; - } - } - - if (index > 0) - { - Array.Resize(ref buffer, index); - yield return buffer; - } - } - } -#endif } diff --git a/src/ProjectTemplates/GeneratedContent.targets b/src/ProjectTemplates/GeneratedContent.targets index 9014b892d98..dae263896a1 100644 --- a/src/ProjectTemplates/GeneratedContent.targets +++ b/src/ProjectTemplates/GeneratedContent.targets @@ -54,7 +54,7 @@ 5.4.8 1.13.0 0.1.11 - 6.0.3 + 10.0.0 @@ -83,7 +83,7 @@ TemplatePackageVersion_OllamaSharp=$(TemplatePackageVersion_OllamaSharp); TemplatePackageVersion_OpenTelemetry=$(TemplatePackageVersion_OpenTelemetry); TemplatePackageVersion_PdfPig=$(TemplatePackageVersion_PdfPig); - TemplatePackageVersion_SystemLinqAsync=$(TemplatePackageVersion_SystemLinqAsync); + TemplatePackageVersion_SystemLinqAsyncEnumerable=$(TemplatePackageVersion_SystemLinqAsyncEnumerable); LocalChatTemplateVariant=$(_LocalChatTemplateVariant); diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/ChatWithCustomData-CSharp.Web.csproj.in b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/ChatWithCustomData-CSharp.Web.csproj.in index 9368b96356f..d10c4cafd7e 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/ChatWithCustomData-CSharp.Web.csproj.in +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/ChatWithCustomData-CSharp.Web.csproj.in @@ -40,7 +40,7 @@ - +