Skip to content

Commit

Permalink
remove net6.0 tagret and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
6bee committed Nov 21, 2024
1 parent 718764c commit 29f5711
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 46 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Removed .NET 6.0 framework target

### Fixed

### Security
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<MinorVersion>3</MinorVersion>
<PatchVersion>0</PatchVersion>
<PreReleaseLabel>dev</PreReleaseLabel>
<AquaCoreVersion>5.4.2</AquaCoreVersion>
<AquaCoreVersion>5.5.0-alpha-001</AquaCoreVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions Remote.Linq.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".global", ".global", "{3FB3
Directory.Build.targets = Directory.Build.targets
GlobalAssemblyInfo.cs = GlobalAssemblyInfo.cs
nuget.config = nuget.config
README.md = README.md
Style.NoDoc.ruleset = Style.NoDoc.ruleset
Style.ruleset = Style.ruleset
Style.Tests.ruleset = Style.Tests.ruleset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
<PackageReference Include="EntityFramework" Version="6.5.1" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<PackageTags>LINQ,expression-tree,lambda,dynamic,remote,remote-query,multi-tier,n-tier,fluent-interface,entity-framework-core,entity-framework,ef-core,ef</PackageTags>
<Description>
Remote linq extensions for EF Core.
Expand All @@ -23,8 +23,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.32" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.17" Condition="'$(TargetFramework)' == 'netstandard2.1'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<PackageReference Include="aqua-core-newtonsoft-json" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Remote.Linq.Text.Json/Remote.Linq.Text.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<PackageTags>remote-linq;json;system-text-json</PackageTags>
<Description>Provides System.Text.Json serialization for Remote.Linq types.</Description>
<IncludeGlobalAssemblyInfo>false</IncludeGlobalAssemblyInfo>
Expand All @@ -15,4 +15,4 @@
<PackageReference Include="aqua-core-text-json" />
</ItemGroup>

</Project>
</Project>
24 changes: 12 additions & 12 deletions src/Remote.Linq/Async/AsyncQueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public static ValueTask<TSource> FirstAsync<TSource>(this IQueryable<TSource> so
public static ValueTask<TSource?> FirstOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.FirstOrDefaultWithPredicate, source, predicate, cancellation);

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> FirstOrDefaultAsync<TSource>(this IQueryable<TSource> source, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.FirstOrDefault, source, cancellation).ConfigureAwait(false)
?? defaultValue;

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> FirstOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.FirstOrDefaultWithPredicate, source, predicate, cancellation).ConfigureAwait(false)
?? defaultValue;
Expand All @@ -104,12 +104,12 @@ public static ValueTask<TSource> SingleAsync<TSource>(this IQueryable<TSource> s
public static ValueTask<TSource?> SingleOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.SingleOrDefaultWithPredicate, source, predicate, cancellation);

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> SingleOrDefaultAsync<TSource>(this IQueryable<TSource> source, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource>(MethodInfos.Queryable.SingleOrDefault, source, cancellation).ConfigureAwait(false)
?? defaultValue;

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> SingleOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource>(MethodInfos.Queryable.SingleOrDefaultWithPredicate, source, predicate, cancellation).ConfigureAwait(false)
?? defaultValue;
Expand All @@ -126,12 +126,12 @@ public static ValueTask<TSource> LastAsync<TSource>(this IQueryable<TSource> sou
public static ValueTask<TSource?> LastOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.LastOrDefaultWithPredicate, source, predicate, cancellation);

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> LastOrDefaultAsync<TSource>(this IQueryable<TSource> source, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource>(MethodInfos.Queryable.LastOrDefault, source, cancellation).ConfigureAwait(false)
?? defaultValue;

// NET6.0 and later
// NET8.0 and later
public static async ValueTask<TSource> LastOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue, CancellationToken cancellation = default)
=> await ExecuteAsync<TSource, TSource>(MethodInfos.Queryable.LastOrDefaultWithPredicate, source, predicate, cancellation).ConfigureAwait(false)
?? defaultValue;
Expand All @@ -142,13 +142,13 @@ public static ValueTask<TSource> ElementAtAsync<TSource>(this IQueryable<TSource
public static ValueTask<TSource?> ElementAtOrDefaultAsync<TSource>(this IQueryable<TSource> source, int index, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.ElementAtOrDefault, source, index, cancellation);

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
public static ValueTask<TSource> ElementAtAsync<TSource>(this IQueryable<TSource> source, Index index, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource>(MethodInfos.Queryable.ElementAt, source, index, cancellation);

public static ValueTask<TSource?> ElementAtOrDefaultAsync<TSource>(this IQueryable<TSource> source, Index index, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.ElementAtOrDefaultWithSystemIndex, source, index, cancellation);
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

public static ValueTask<bool> ContainsAsync<TSource>(this IQueryable<TSource> source, TSource item, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, bool>(MethodInfos.Queryable.Contains, source, item, cancellation);
Expand Down Expand Up @@ -197,7 +197,7 @@ public static ValueTask<long> LongCountAsync<TSource>(this IQueryable<TSource> s
public static ValueTask<TResult?> MinAsync<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TResult?>(MethodInfos.Queryable.MinWithSelector, source, selector, cancellation);

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
public static ValueTask<TSource?> MinAsync<TSource>(this IQueryable<TSource> source, IComparer<TSource> comparer, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.MinWithComparer, source, comparer, cancellation);

Expand All @@ -206,15 +206,15 @@ public static ValueTask<long> LongCountAsync<TSource>(this IQueryable<TSource> s

public static ValueTask<TSource?> MinByAsync<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource> comparer, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.MinByWithComparer, source, new object?[] { keySelector, comparer }, cancellation);
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

public static ValueTask<TSource?> MaxAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.Max, source, cancellation);

public static ValueTask<TResult?> MaxAsync<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TResult?>(MethodInfos.Queryable.MaxWithSelector, source, selector, cancellation);

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
public static ValueTask<TSource?> MaxAsync<TSource>(this IQueryable<TSource> source, IComparer<TSource>? comparer, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.MaxWithComparer, source, comparer, cancellation);

Expand All @@ -223,7 +223,7 @@ public static ValueTask<long> LongCountAsync<TSource>(this IQueryable<TSource> s

public static ValueTask<TSource?> MaxByAsync<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer, CancellationToken cancellation = default)
=> ExecuteAsync<TSource, TSource?>(MethodInfos.Queryable.MaxByWithComparer, source, new object?[] { keySelector, comparer }, cancellation);
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

public static ValueTask<int> SumAsync(this IQueryable<int> source, CancellationToken cancellation = default)
=> ExecuteAsync<int, int>(MethodInfos.Queryable.SumInt32, source, cancellation);
Expand Down
12 changes: 6 additions & 6 deletions src/Remote.Linq/MethodInfos.Queryable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ internal static class Queryable
typeof(IQueryable<TSource>),
typeof(int));

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
internal static readonly MethodInfo ElementAtWithSystemIndex = GetQueryableMethod(
nameof(System.Linq.Queryable.ElementAt),
typeof(IQueryable<TSource>),
Expand All @@ -137,7 +137,7 @@ internal static class Queryable
nameof(System.Linq.Queryable.ElementAtOrDefault),
typeof(IQueryable<TSource>),
typeof(Index));
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

internal static readonly MethodInfo First = GetQueryableMethod(
nameof(System.Linq.Queryable.First),
Expand Down Expand Up @@ -194,7 +194,7 @@ internal static class Queryable
typeof(IQueryable<TSource>),
typeof(Expression<Func<TSource, TResult>>));

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
internal static readonly MethodInfo MaxWithComparer = GetQueryableMethod(
nameof(System.Linq.Queryable.Max),
[typeof(TSource)],
Expand All @@ -213,7 +213,7 @@ internal static class Queryable
typeof(IQueryable<TSource>),
typeof(Expression<Func<TSource, TKey>>),
typeof(IComparer<TSource>));
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

internal static readonly MethodInfo Min = GetQueryableMethod(
nameof(System.Linq.Queryable.Min),
Expand All @@ -225,7 +225,7 @@ internal static class Queryable
typeof(IQueryable<TSource>),
typeof(Expression<Func<TSource, TResult>>));

#if NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
internal static readonly MethodInfo MinWithComparer = GetQueryableMethod(
nameof(System.Linq.Queryable.Min),
[typeof(TSource)],
Expand All @@ -244,7 +244,7 @@ internal static class Queryable
typeof(IQueryable<TSource>),
typeof(Expression<Func<TSource, TKey>>),
typeof(IComparer<TSource>));
#endif // NET6_0_OR_GREATER
#endif // NET8_0_OR_GREATER

internal static readonly MethodInfo SequenceEqualWithComparer = GetQueryableMethod(
nameof(System.Linq.Queryable.SequenceEqual),
Expand Down
4 changes: 2 additions & 2 deletions src/Remote.Linq/Remote.Linq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<Summary>Simply LINQ your remote resources...</Summary>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<PackageTags>LINQ;expression-tree;lambda;dynamic;remote;remote-query;multi-tier;n-tier;fluent-interface</PackageTags>
<Description>Remote Linq is a small and easy to use - yet very powerful - library to translate linq expression trees to strongly typed, serializable object trees and vice versa. It provides functionality to send arbitrary linq queries to a remote service to be applied and executed against any enumerable or queryable data source.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="aqua-core" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Tests for Remote.Linq.EntityFramework</Description>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Tests for Remote.Linq.EntityFramework</Description>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Tests for Remote.Linq.EntityFrameworkCore</Description>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,8 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.32" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.20" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Remote.Linq.Tests/Remote.Linq.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Tests for Remote.Linq</Description>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions test/Remote.Linq.Tests/RemoteQueryable/When_running_query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,9 @@ public void Should_query_primitive_value_injected_as_variable_closure(Type type,
SystemTextJsonSerializationHelper.SkipUnsupportedDataType(type, value);
}

#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
Skip.If(type.Is<Half>(), $"{type} not supported by serializers");
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER

RunTestMethod(
nameof(TestMethodFor_Should_query_primitive_value_injected_as_variable_closure),
Expand Down Expand Up @@ -976,9 +976,9 @@ public void Should_query_primitive_value_collection_injected_as_variable_closure
SystemTextJsonSerializationHelper.SkipUnsupportedDataType(type, value);
}

#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
Skip.If(type.Is<Half>(), $"{type} not supported by serializers");
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER

RunTestMethod(
nameof(TestMethodFor_Should_query_primitive_value_collection_injected_as_variable_closure),
Expand Down Expand Up @@ -1009,9 +1009,9 @@ public void Should_query_anonymous_type_with_primitive_value_injected_as_variabl
{
SystemTextJsonSerializationHelper.SkipUnsupportedDataType(type, value);
}
#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
Skip.If(type.Is<Half>(), $"{type} not supported by serializers");
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER

RunTestMethod(
nameof(TestMethodFor_Should_query_anonymous_type_with_primitive_value_injected_as_variable_closure),
Expand Down Expand Up @@ -1043,9 +1043,9 @@ public void Should_query_anonymous_type_with_primitive_value_collection_injected
{
SystemTextJsonSerializationHelper.SkipUnsupportedDataType(type, value);
}
#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
Skip.If(type.Is<Half>(), $"{type} not supported by serializers");
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER

RunTestMethod(
nameof(TestMethodFor_Should_query_anonymous_type_with_primitive_value_collection_injected_as_variable_closure),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static void SkipUnsupportedDataType(Type type, object value)
Skip.If(type.Is<BigInteger>(), $"{type} not supported by out-of-the-box protobuf-net");
Skip.If(type.Is<Complex>(), $"{type} not supported by out-of-the-box protobuf-net");
Skip.If(type.IsNotPublic(), $"Not-public {type} not supported protobuf-net");
#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
Skip.If(type.Is<Half>(), $"{type} not supported by serializers");
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER
}
}
4 changes: 2 additions & 2 deletions test/Remote.Linq.Tests/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public enum Custom
new Complex(-87654, 234),
new Complex(double.MinValue, double.MinValue),
new Complex(double.MaxValue, double.MaxValue),
#if NET5_0_OR_GREATER
#if NET8_0_OR_GREATER
(Half)Math.PI,
Half.MinValue,
Half.MaxValue,
#endif // NET5_0_OR_GREATER
#endif // NET8_0_OR_GREATER
new { Text = string.Empty, Timestamp = default(DateTime?) },
}
.SelectMany(x => new (Type Type, object Value)[]
Expand Down

0 comments on commit 29f5711

Please sign in to comment.