This commit is contained in:
Loretta 2025-08-31 12:22:14 +02:00
commit 9ed82f8f5e
4 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>

View File

@ -6,6 +6,17 @@ namespace AyCode.Core.Extensions
{
public static class CollectionExtensions
{
public static void UpdateCollection<TDataItem>(this IList<TDataItem> source, IList<TDataItem> dataItems, bool isRemove) where TDataItem : IId<Guid>
{
if (source == null) throw new ArgumentNullException(nameof(source), $"source == null");
if (dataItems == null) throw new ArgumentNullException(nameof(dataItems), $"dataItems == null");
foreach (var dataItem in dataItems)
{
source.UpdateCollection(dataItem, isRemove);
}
}
public static TrackingState UpdateCollection<TDataItem>(this IList<TDataItem> source, TDataItem dataItem, bool isRemove) where TDataItem : IId<Guid>
{
if (source == null) throw new ArgumentNullException(nameof(source), $"source == null");

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Include="JetBrains.Annotations" Version="2025.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="9.0.8" />
</ItemGroup>