Skip to content

Commit

Permalink
update to linq2db 4.4.0 and implement remaining net7 migrations (#279)
Browse files Browse the repository at this point in the history
* update to linq2db 4.4.0 and implement remaining  net7 migrations

* update
  • Loading branch information
MaceWindu authored Dec 15, 2022
1 parent 7393c62 commit e4d2abc
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Build/linq2db.Default.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>7.0.0</Version>
<Version>7.1.0</Version>

<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
<Product>Linq to DB</Product>
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project>
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="FluentAssertions" Version="6.8.0" />

<PackageVersion Include="linq2db" Version="4.3.0" />
<PackageVersion Include="linq2db.Tools" Version="4.3.0" />
<PackageVersion Include="linq2db" Version="4.4.0" />
<PackageVersion Include="linq2db.Tools" Version="4.4.0" />

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />

Expand All @@ -16,10 +16,10 @@
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />

<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0-silver.1" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />

<PackageVersion Include="EntityFrameworkCore.FSharp" Version="6.0.7" />
<PackageVersion Include="FSharp.Core" Version="7.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion NuGet/linq2db.EntityFrameworkCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependencies>
<group targetFramework="net6.0">
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="7.0.0" />
<dependency id="linq2db" version="4.3.0" />
<dependency id="linq2db" version="4.4.0" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public virtual MappingSchema GetMappingSchema(
/// </summary>
/// <param name="ex">Expression.</param>
/// <returns>Unwrapped expression.</returns>
[return: NotNullIfNotNull("ex")]
[return: NotNullIfNotNull(nameof(ex))]
public static Expression? Unwrap(Expression? ex)
{
if (ex == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private static Expression RewriteShadowPropertyAccess(Expression expression)

private sealed class ShadowStateAccessRewriter : ExpressionVisitor
{
[return: NotNullIfNotNull("expr")]
[return: NotNullIfNotNull(nameof(expr))]
static Expression? RemoveConvert(Expression? expr)
{
while (expr?.NodeType.In(ExpressionType.Convert, ExpressionType.ConvertChecked) == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

<ItemGroup>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" />
<!--TODO: remove after v7 release-->
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational">
<NoWarn>NU1107;NU1608</NoWarn>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ public static string ToSnakeCase(this string input)
if (string.IsNullOrEmpty(input))
return input;

var startUnderscores = UnderscoresMatcher.Match(input);
return startUnderscores + Replacer.Replace(input, "$1_$2").ToLowerInvariant();
var startUnderscores = UnderscoresMatcher().Match(input);
return startUnderscores + Replacer().Replace(input, "$1_$2").ToLowerInvariant();
}

// TODO: uncomment after azure pipelines updated to 17.4
//[GeneratedRegex("^_+")]
//private static partial Regex UnderscoresMatcher();
//[GeneratedRegex("([a-z0-9])([A-Z])")]
//private static partial Regex Replacer();

#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.
private static readonly Regex UnderscoresMatcher = new ("^_+", RegexOptions.Compiled);
private static readonly Regex Replacer = new ("([a-z0-9])([A-Z])", RegexOptions.Compiled);
#pragma warning restore SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.
[GeneratedRegex("^_+")]
private static partial Regex UnderscoresMatcher();
[GeneratedRegex("([a-z0-9])([A-Z])")]
private static partial Regex Replacer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace LinqToDB.EntityFrameworkCore.PostgreSQL.Tests.SampleTests
{
public static class TypeExtensions
{
[return: NotNullIfNotNull("type")]
[return: NotNullIfNotNull(nameof(type))]
public static Type? UnwrapNullable(this Type? type)
=> type == null ? null : Nullable.GetUnderlyingType(type) ?? type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ public ExpressionReplacer(IDictionary<Expression, Expression> replaceMap)
_replaceMap = replaceMap ?? throw new ArgumentNullException(nameof(replaceMap));
}

// TODO: uncomment after azure pipelines updated to 17.4
//[return: NotNullIfNotNull(nameof(node))]
[return: NotNullIfNotNull("node")]
[return: NotNullIfNotNull(nameof(node))]
public override Expression? Visit(Expression? node)
{
if (node != null && _replaceMap.TryGetValue(node, out var replacement))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override IEnumerable<ValueConverterInfo> Select(Type modelClrType, Type?
i => (ValueConverter)Activator.CreateInstance(ct, i.MappingHints)!
);

[return: NotNullIfNotNull("type")]
[return: NotNullIfNotNull(nameof(type))]
static Type? Unwrap(Type? type) => type == null ? null : Nullable.GetUnderlyingType(type) ?? type;
}
}}
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
variables:
solution: 'linq2db.EFCore.sln'
build_configuration: 'Release'
assemblyVersion: 7.0.0
nugetVersion: 7.0.0
assemblyVersion: 7.1.0
nugetVersion: 7.1.0
artifact_nugets: 'nugets'

# build on commits to important branches (master + release branches):
Expand Down

0 comments on commit e4d2abc

Please sign in to comment.