Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 6eaa101

Browse files
authored
Merge pull request #25 from linq2db/version1
Release 1.7.1
2 parents 5fde6fb + 548d19e commit 6eaa101

22 files changed

+582
-404
lines changed

Build/AppVeyor.FixVersionProps.ps1

Lines changed: 0 additions & 40 deletions
This file was deleted.

Build/AppVeyor.NUnit.Tests.ps1

Lines changed: 0 additions & 9 deletions
This file was deleted.

Build/SetVersion.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Param(
2+
[Parameter(Mandatory=$true)][string]$path,
3+
[Parameter(Mandatory=$true)][string]$version
4+
)
5+
6+
$ErrorActionPreference = "Stop"
7+
Set-StrictMode -Version Latest
8+
9+
if ($version) {
10+
11+
$xmlPath = Resolve-Path "$path"
12+
13+
$xml = [XML](Get-Content "$xmlPath")
14+
$xml.PreserveWhitespace = $true
15+
$save = $false
16+
17+
$xPath = "//PropertyGroup/Version"
18+
$nodes = $xml.SelectNodes($xPath)
19+
foreach($node in $nodes) {
20+
$node.InnerXml = $version
21+
$save = $true
22+
}
23+
24+
if ($save) {
25+
Write-Host "Patched $xmlPath"
26+
$xml.Save($xmlPath)
27+
}
28+
}

Build/linq2db.Default.props

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.1</Version>
4-
<PackageVersion>1.0.1</PackageVersion>
3+
<Version>1.7.1</Version>
54

65
<Description>Allows to execute Linq to DB (linq2db) queries in Entity Framework Core DbContext.</Description>
76
<Title>Linq to DB (linq2db) extensions for Entity Framework Core</Title>
87
<AssemblyTitle>$(Title)</AssemblyTitle>
98
<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
109
<Product>Linq to DB</Product>
1110
<Company>linq2db.net</Company>
12-
<Copyright>2002-2018 linq2db.net</Copyright>
11+
<Copyright>2002-2020 linq2db.net</Copyright>
1312
<RepositoryUrl>https://github.com/linq2db/linq2db.EntityFrameworkCore</RepositoryUrl>
1413
<RepositoryType>git</RepositoryType>
15-
<PackageIconUrl>http://www.gravatar.com/avatar/fc2e509b6ed116b9aa29a7988fdb8990?s=320</PackageIconUrl>
1614

1715
<AppDesignerFolder>Properties</AppDesignerFolder>
18-
<LangVersion>latest</LangVersion>
16+
<LangVersion>8.0</LangVersion>
17+
<Nullable>disable</Nullable>
1918
<WarningLevel>4</WarningLevel>
2019
<ErrorReport>prompt</ErrorReport>
21-
<NoWarn>1701;1702;1705;1591</NoWarn>
20+
<NoWarn>1701;1591</NoWarn>
2221

23-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
22+
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
2423
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
2524
<SignAssembly>True</SignAssembly>
26-
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
27-
<AssemblyOriginatorKeyFile Condition="Exists('..\Build\linq2db.snk')">..\Build\linq2db.snk</AssemblyOriginatorKeyFile>
28-
<AssemblyOriginatorKeyFile Condition="Exists('..\..\Build\linq2db.snk')">..\..\Build\linq2db.snk</AssemblyOriginatorKeyFile>
25+
<AssemblyOriginatorKeyFile>..\..\Build\linq2db.snk</AssemblyOriginatorKeyFile>
2926
<DelaySign>False</DelaySign>
3027

3128
<GenerateAssemblyTitleAttribute>true</GenerateAssemblyTitleAttribute>

NuGet/BuildNuspecs.ps1

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Param(
2+
[Parameter(Mandatory=$true)][string]$path,
3+
[Parameter(Mandatory=$true)][string]$version,
4+
[Parameter(Mandatory=$false)][string]$branch
5+
)
6+
7+
$ErrorActionPreference = "Stop"
8+
Set-StrictMode -Version Latest
9+
10+
if ($version) {
11+
12+
$nsUri = 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'
13+
$ns = @{ns=$nsUri}
14+
$commit = (git rev-parse HEAD)
15+
if (-not $branch) {
16+
$branch = (git rev-parse --abbrev-ref HEAD)
17+
}
18+
19+
Get-ChildItem $path | ForEach {
20+
$xmlPath = Resolve-Path $_.FullName
21+
22+
$xml = [xml] (Get-Content "$xmlPath")
23+
$xml.PreserveWhitespace = $true
24+
25+
# set version metadata
26+
$child = $xml.CreateElement('version', $nsUri)
27+
$child.InnerText = $version
28+
$xml.package.metadata.AppendChild($child)
29+
30+
# set repository/commit link
31+
$child = $xml.CreateElement('repository', $nsUri)
32+
$attr = $xml.CreateAttribute('type')
33+
$attr.Value = 'git'
34+
$child.Attributes.Append($attr)
35+
$attr = $xml.CreateAttribute('url')
36+
$attr.Value = 'https://github.com/linq2db/linq2db.EntityFrameworkCore.git'
37+
$child.Attributes.Append($attr)
38+
$attr = $xml.CreateAttribute('branch')
39+
$attr.Value = $branch
40+
$child.Attributes.Append($attr)
41+
$attr = $xml.CreateAttribute('commit')
42+
$attr.Value = $commit
43+
$child.Attributes.Append($attr)
44+
$xml.package.metadata.AppendChild($child)
45+
46+
$xml.Save($xmlPath)
47+
}
48+
}

NuGet/icon.png

3.44 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>linq2db.EntityFrameworkCore</id>
5+
<title>Linq to DB (linq2db) extensions for Entity Framework Core</title>
6+
<authors>Igor Tkachev, Ilya Chudin, Svyatoslav Danyliv, Dmitry Lukashenko</authors>
7+
<owners>Igor Tkachev, Ilya Chudin, Svyatoslav Danyliv, Dmitry Lukashenko</owners>
8+
<copyright>Copyright © 2020 Igor Tkachev, Ilya Chudin, Svyatoslav Danyliv, Dmitry Lukashenko</copyright>
9+
<description>Allows to execute Linq to DB (linq2db) queries in Entity Framework Core DbContext.</description>
10+
<summary />
11+
<tags>linq linq2db LinqToDB ORM database entity-framework-core EntityFrameworkCore EFCore DB SQL SqlServer SqlCe SqlServerCe MySql Firebird SQLite Oracle ODP PostgreSQL DB2</tags>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<icon>images\icon.png</icon>
14+
<projectUrl>https://github.com/linq2db/linq2db.EntityFrameworkCore</projectUrl>
15+
<license type="file">MIT-LICENSE.txt</license>
16+
<dependencies>
17+
<group targetFramework=".NETStandard2.0">
18+
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="2.2.6" />
19+
<dependency id="linq2db" version="2.9.6" />
20+
</group>
21+
</dependencies>
22+
</metadata>
23+
24+
<files>
25+
<file src="..\Source\LinqToDB.EntityFrameworkCore\bin\Release\**\linq2db.EntityFrameworkCore.pdb" target="lib\" />
26+
<file src="..\Source\LinqToDB.EntityFrameworkCore\bin\Release\**\linq2db.EntityFrameworkCore.xml" target="lib\" />
27+
<file src="..\Source\LinqToDB.EntityFrameworkCore\bin\Release\**\linq2db.EntityFrameworkCore.dll" target="lib\" />
28+
29+
<file src="..\MIT-LICENSE.txt" />
30+
31+
<file src="icon.png" target="images\icon.png" />
32+
</files>
33+
</package>

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1+
2+
13
# linq2db.EntityFrameworkCore
24

35
`linq2db.EntityFrameworkCore` is an integration of `LINQ To DB` with existing EntityFrameworkCore projects. It was inspired by [this issue](https://github.com/aspnet/EntityFrameworkCore/issues/11657) in EF.Core repository.
46

57
## Build status
68

7-
| |Appveyor|
8-
-----|-------
9-
|master|[![Master](https://ci.appveyor.com/api/projects/status/vmp9pj4gqrch4x3x/branch/master?svg=true)](https://ci.appveyor.com/project/igor-tkachev/linq2db-entityframeworkcore/branch/master)
10-
|latest|[![Latest](https://ci.appveyor.com/api/projects/status/vmp9pj4gqrch4x3x?svg=true)](https://ci.appveyor.com/project/igor-tkachev/linq2db-entityframeworkcore)
9+
[![Azure DevOps builds](https://img.shields.io/azure-devops/build/linq2db/0dcc414b-ea54-451e-a54f-d63f05367c4b/7/version1?label=v1%20master)](https://dev.azure.com/linq2db/linq2db/_build?definitionId=7)
10+
[![Azure DevOps builds](https://img.shields.io/azure-devops/build/linq2db/0dcc414b-ea54-451e-a54f-d63f05367c4b/7?label=latest)](https://dev.azure.com/linq2db/linq2db/_build?definitionId=7)
1111

1212
## Feeds
1313

1414
* NuGet [![NuGet](https://img.shields.io/nuget/vpre/linq2db.EntityFrameworkCore.svg)](https://www.nuget.org/packages/linq2db.EntityFrameworkCore)
15-
* MyGet [![MyGet](https://img.shields.io/myget/linq2db/vpre/linq2db.EntityFrameworkCore.svg)](https://www.myget.org/feed/linq2db/package/nuget/linq2db.EntityFrameworkCore)
16-
* V2 `https://www.myget.org/F/linq2db/api/v2`
17-
* V3 `https://www.myget.org/F/linq2db/api/v3/index.json`
15+
* Azure Artifacts [![MyGet](https://img.shields.io/badge/azure-download-yellowgreen)](https://dev.azure.com/linq2db/linq2db/_packaging?_a=package&feed=linq2db&view=versions&package=linq2db.EntityFrameworkCore&protocolType=NuGet)
1816

1917
# How to use
2018

@@ -130,7 +128,7 @@ There are many reasons. Some of them:
130128

131129
# Current status
132130

133-
Right now it is an early preview. Below is a list of providers, that should work right now:
131+
Below is a list of providers, that should work right now:
134132

135133
- SQL Server
136134
- MySQL (including Devart and Pomelo providers)

Source/LinqToDB.EntityFrameworkCore/ILinqToDBForEFTools.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ public interface ILinqToDBForEFTools
4646
/// <param name="model">EF.Core data model.</param>
4747
/// <param name="metadataReader">Additional optional LINQ To DB database metadata provider.</param>
4848
/// <returns>Mapping schema for provided EF.Core model.</returns>
49+
MappingSchema CreateMappingSchema(IModel model, IMetadataReader metadataReader);
50+
51+
/// <summary>
52+
/// Returns mapping schema using provided EF.Core data model and metadata provider.
53+
/// </summary>
54+
/// <param name="model">EF.Core data model.</param>
55+
/// <param name="metadataReader">Additional optional LINQ To DB database metadata provider.</param>
56+
/// <returns>Mapping schema for provided EF.Core model.</returns>
4957
MappingSchema GetMappingSchema(IModel model, IMetadataReader metadataReader);
5058

5159
/// <summary>
@@ -60,9 +68,10 @@ public interface ILinqToDBForEFTools
6068
/// </summary>
6169
/// <param name="expression">EF.Core expression tree.</param>
6270
/// <param name="dc">LINQ To DB <see cref="IDataContext"/> instance.</param>
71+
/// <param name="ctx">Optional DbContext instance.</param>
6372
/// <param name="model">EF.Core data model instance.</param>
6473
/// <returns>Transformed expression.</returns>
65-
Expression TransformExpression(Expression expression, IDataContext dc, IModel model);
74+
Expression TransformExpression(Expression expression, IDataContext dc, DbContext ctx, IModel model);
6675

6776
/// <summary>
6877
/// Extracts <see cref="DbContext"/> instance from <see cref="IQueryable"/> object.

Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public TResult Execute<TResult>(Expression expression)
5656

5757
public System.Collections.Generic.IAsyncEnumerable<TResult> ExecuteAsync<TResult>(Expression expression)
5858
{
59-
return new AsyncEnumerableAdaper<TResult>(QueryProvider.ExecuteAsync<TResult>(expression));
59+
return new AsyncEnumerableAdapter<TResult>(QueryProvider.ExecuteAsync<TResult>(expression));
6060
}
6161

6262
IAsyncEnumerable<TResult> IQueryProviderAsync.ExecuteAsync<TResult>(Expression expression)
@@ -92,11 +92,11 @@ System.Collections.Generic.IAsyncEnumerator<T> System.Collections.Generic.IAsync
9292
return ExecuteAsync<T>(Expression).GetEnumerator();
9393
}
9494

95-
class AsyncEnumerableAdaper<TEntity> : System.Collections.Generic.IAsyncEnumerable<TEntity>
95+
class AsyncEnumerableAdapter<TEntity> : System.Collections.Generic.IAsyncEnumerable<TEntity>
9696
{
9797
private IAsyncEnumerable<TEntity> AsyncEnumerable { get; }
9898

99-
public AsyncEnumerableAdaper(IAsyncEnumerable<TEntity> asyncEnumerable)
99+
public AsyncEnumerableAdapter(IAsyncEnumerable<TEntity> asyncEnumerable)
100100
{
101101
AsyncEnumerable = asyncEnumerable;
102102
}

0 commit comments

Comments
 (0)