Skip to content

Commit

Permalink
Merge pull request #181 from linq2db/version3
Browse files Browse the repository at this point in the history
Release 3.15.0
  • Loading branch information
sdanyliv authored Oct 6, 2021
2 parents 7411783 + 39be80b commit de3bb2a
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 7 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>3.14.0</Version>
<Version>3.15.0</Version>

<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
<Product>Linq to DB</Product>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<PackageVersion Include="NUnit" Version="3.13.2" />
<PackageVersion Include="FluentAssertions" Version="5.10.3" />

<PackageVersion Include="linq2db" Version="3.4.4" />
<PackageVersion Include="linq2db.Tools" Version="3.4.4" />
<PackageVersion Include="linq2db" Version="3.4.5" />
<PackageVersion Include="linq2db.Tools" Version="3.4.5" />

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.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=".NETStandard2.0">
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="3.1.11" />
<dependency id="linq2db" version="3.4.4" />
<dependency id="linq2db" version="3.4.5" />
</group>
</dependencies>
</metadata>
Expand Down
13 changes: 12 additions & 1 deletion Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,23 @@ public override int GetHashCode()
return found;
}

private static PropertyInfo GetPropertyInfoForType(Type type, PropertyInfo propInfo)
{
if (propInfo.DeclaringType == type)
return propInfo;

var found = type.GetProperties()
.FirstOrDefault(x => x.Module == propInfo.Module && x.MetadataToken == propInfo.MetadataToken);

return found ?? propInfo;
}

private Sql.ExpressionAttribute? GetDbFunctionFromProperty(Type type, PropertyInfo propInfo)
{
if (_dependencies == null || _model == null)
return null;

propInfo = (PropertyInfo?) type.GetMemberEx(propInfo) ?? propInfo;
propInfo = GetPropertyInfoForType(type, propInfo);

var found = _calculatedExtensions.GetOrAdd(propInfo, mi =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,14 @@ public virtual async Task TestUIntTable()
var item = await context.UIntTable.FirstOrDefaultAsyncLinqToDB(e => e.Field64 == field64);
}

[Test]
public virtual void TestAmbiguousProperties()
{
using var context = CreateContext();

FluentActions.Awaiting(() => context.WithDuplicateProperties.Where(x => x.Value == 1)
.ToArrayAsyncLinqToDB()).Should().NotThrow();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ protected ForMappingContextBase(DbContextOptions options) : base(options)
public DbSet<NoIdentity> NoIdentity { get; set; } = null!;
public DbSet<UIntTable> UIntTable { get; set; } = null!;
public DbSet<StringTypes> StringTypes { get; set; } = null!;

public DbSet<WithDuplicateProperties> WithDuplicateProperties { get; set; } = null!;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;

namespace LinqToDB.EntityFrameworkCore.BaseTests.Models.ForMapping
{

public class WithDuplicatePropertiesBase
{
[Key]
public int Id { get; set; }

public virtual string? Value { get; set; }
}

public class WithDuplicateProperties : WithDuplicatePropertiesBase
{
public new int? Value { get; set; }
}
}
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: 3.14.0
nugetVersion: 3.14.0
assemblyVersion: 3.15.0
nugetVersion: 3.15.0
artifact_nugets: 'nugets'

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

0 comments on commit de3bb2a

Please sign in to comment.