Skip to content

Commit 20f5cfa

Browse files
Merge pull request #129 from Tasteful/feature/ef63
Add support for EF 6.3
2 parents b672038 + 5a3c9e9 commit 20f5cfa

File tree

8 files changed

+44
-67
lines changed

8 files changed

+44
-67
lines changed

AutoMapper.Collection.sln

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2010
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29411.108
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19AAEE83-5EEC-4EAA-9CF7-16F8ED58B50E}"
77
ProjectSection(SolutionItems) = preProject
@@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19AAEE
1010
EndProject
1111
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{578F2483-CF08-409D-A316-31BCB7C5D9D0}"
1212
ProjectSection(SolutionItems) = preProject
13+
appveyor.yml = appveyor.yml
1314
Directory.Build.props = Directory.Build.props
1415
global.json = global.json
1516
README.md = README.md
@@ -22,9 +23,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoMapper.Collection.Entit
2223
EndProject
2324
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoMapper.Collection.LinqToSQL", "src\AutoMapper.Collection.LinqToSQL\AutoMapper.Collection.LinqToSQL.csproj", "{A0A023B6-D02A-4CD3-9B3D-3B3022DB001A}"
2425
EndProject
25-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoMapper.Collection.Tests", "src\AutoMapper.Collection.Tests\AutoMapper.Collection.Tests.csproj", "{2D3D34AD-6A0A-4382-9A2F-894F52D184A7}"
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoMapper.Collection.Tests", "src\AutoMapper.Collection.Tests\AutoMapper.Collection.Tests.csproj", "{2D3D34AD-6A0A-4382-9A2F-894F52D184A7}"
2627
EndProject
27-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoMapper.Collection.EntityFramework.Tests", "src\AutoMapper.Collection.EntityFramework.Tests\AutoMapper.Collection.EntityFramework.Tests.csproj", "{BDE127AB-AC3F-44DF-BC33-210DAFD12E15}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoMapper.Collection.EntityFramework.Tests", "src\AutoMapper.Collection.EntityFramework.Tests\AutoMapper.Collection.EntityFramework.Tests.csproj", "{BDE127AB-AC3F-44DF-BC33-210DAFD12E15}"
2829
EndProject
2930
Global
3031
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Directory.Build.props

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
<Import Project="version.props" />
33

44
<PropertyGroup>
5-
<EFVersion>6.1.3</EFVersion>
65
<FluentAssertions>4.15.0</FluentAssertions>
76
<TestSDKVersion>15.5.0</TestSDKVersion>
8-
<xUnitVersion>2.3.1</xUnitVersion>
9-
<SqlServerCompactVersion>4.0.8876.1</SqlServerCompactVersion>
7+
<xUnitVersion>2.4.1</xUnitVersion>
8+
<EffortVersion>2.2.1</EffortVersion>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
12+
<EFVersion>6.1.3</EFVersion>
1013
</PropertyGroup>
14+
15+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.0' ">
16+
<EFVersion>6.3.0</EFVersion>
17+
</PropertyGroup>
18+
1119
</Project>

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ branches:
55
only:
66
- master
77
- development
8-
image: Visual Studio 2017
8+
image: Visual Studio 2019
99
nuget:
1010
disable_publish_on_pr: true
11+
environment:
12+
DOTNET_CLI_VERSION: 3.0.100
13+
DOTNET_CLI_TELEMETRY_OPTOUT: true
1114
build_script:
1215
- cmd: .\build.cmd
1316
test: off

build.ps1

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ task compile -depends clean {
3838
$buildParam = @{ $true = ""; $false = "--version-suffix=$buildSuffix"}[$tag -ne $NULL -and $revision -ne "local"]
3939
$packageParam = @{ $true = ""; $false = "--version-suffix=$suffix"}[$tag -ne $NULL -and $revision -ne "local"]
4040

41-
echo "build: Tag is $tag"
42-
echo "build: Package version suffix is $suffix"
43-
echo "build: Build version suffix is $buildSuffix"
41+
Write-Output "build: Tag is $tag"
42+
Write-Output "build: Package version suffix is $suffix"
43+
Write-Output "build: Build version suffix is $buildSuffix"
4444

4545
# restore all project references (creating project.assets.json for each project)
4646
exec { dotnet restore $base_dir\AutoMapper.Collection.sln /nologo }
@@ -60,29 +60,30 @@ task test {
6060

6161
function Install-Dotnet
6262
{
63-
$dotnetcli = where-is('dotnet')
63+
$dotnetCli = (where-is "dotnet" | Select-Object -First 1)
64+
$install = ($null -eq $dotnetCli -or ($null -ne $env:DOTNET_CLI_VERSION -and $null -eq (&"$dotnetCli" --info | Where-Object { $_ -like " $env:DOTNET_CLI_VERSION*" })))
6465

65-
if($dotnetcli -eq $null)
66-
{
66+
if ($install)
67+
{
6768
$dotnetPath = "$pwd\.dotnet"
68-
$dotnetCliVersion = if ($env:DOTNET_CLI_VERSION -eq $null) { 'Latest' } else { $env:DOTNET_CLI_VERSION }
69-
$dotnetInstallScriptUrl = 'https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1'
70-
$dotnetInstallScriptPath = '.\scripts\obtain\install.ps1'
69+
$dotnetCliVersion = if ($null -eq $env:DOTNET_CLI_VERSION) { 'Latest' } else { $env:DOTNET_CLI_VERSION }
70+
$dotnetInstallScriptUrl = 'https://raw.githubusercontent.com/dotnet/cli/v2.1.4/scripts/obtain/dotnet-install.ps1'
71+
$dotnetInstallScriptPath = '.\scripts\obtain\dotnet-install.ps1'
7172

72-
md -Force ".\scripts\obtain\" | Out-Null
73-
curl $dotnetInstallScriptUrl -OutFile $dotnetInstallScriptPath
74-
& .\scripts\obtain\install.ps1 -Channel "preview" -version $dotnetCliVersion -InstallDir $dotnetPath -NoPath
73+
mkdir -Force ".\scripts\obtain\" | Out-Null
74+
Invoke-WebRequest $dotnetInstallScriptUrl -OutFile $dotnetInstallScriptPath
75+
& .\scripts\obtain\dotnet-install.ps1 -Channel "preview" -version $dotnetCliVersion -InstallDir $dotnetPath -NoPath
7576
$env:Path = "$dotnetPath;$env:Path"
7677
}
7778
}
7879

7980
function where-is($command) {
80-
(ls env:\path).Value.split(';') | `
81-
where { $_ } | `
82-
%{ [System.Environment]::ExpandEnvironmentVariables($_) } | `
83-
where { test-path $_ } |`
84-
%{ ls "$_\*" -include *.bat,*.exe,*cmd } | `
85-
%{ $file = $_.Name; `
81+
(Get-ChildItem env:\path).Value.split(';') | `
82+
Where-Object { $_ } | `
83+
ForEach-Object{ [System.Environment]::ExpandEnvironmentVariables($_) } | `
84+
Where-Object { test-path $_ } |`
85+
ForEach-Object{ Get-ChildItem "$_\*" -include *.bat,*.exe,*cmd } | `
86+
ForEach-Object{ $file = $_.Name; `
8687
if($file -and ($file -eq $command -or `
8788
$file -eq ($command + '.exe') -or `
8889
$file -eq ($command + '.bat') -or `
@@ -91,5 +92,5 @@ function where-is($command) {
9192
$_.FullName `
9293
} `
9394
} | `
94-
select -unique
95+
Select-Object -unique
9596
}

src/AutoMapper.Collection.EntityFramework.Tests/App.config

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

src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461</TargetFrameworks>
4+
<TargetFrameworks>net461;netcoreapp3.0</TargetFrameworks>
55
<AssemblyName>AutoMapper.Collection.EntityFramework.Tests</AssemblyName>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
@@ -10,18 +10,12 @@
1010
<ProjectReference Include="..\AutoMapper.Collection.EntityFramework\AutoMapper.Collection.EntityFramework.csproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
14-
<Reference Include="System" />
15-
<Reference Include="Microsoft.CSharp" />
16-
</ItemGroup>
17-
1813
<ItemGroup>
1914
<PackageReference Include="FluentAssertions" Version="$(FluentAssertions)" />
2015
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSDKVersion)" />
2116
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
2217
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)" />
23-
<PackageReference Include="EntityFramework.SqlServerCompact" Version="$(EfVersion)" />
24-
<PackageReference Include="Microsoft.SqlServer.Compact" Version="$(SqlServerCompactVersion)" />
18+
<PackageReference Include="Effort.EF6" Version="$(EffortVersion)" />
2519
</ItemGroup>
2620

2721
<ItemGroup>

src/AutoMapper.Collection.EntityFramework.Tests/EntityFramworkTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Data.Entity;
4-
using System.Data.SqlServerCe;
54
using System.Linq;
65
using AutoMapper.EntityFramework;
76
using AutoMapper.EquivalencyExpression;
@@ -69,7 +68,7 @@ public void Should_Persist_To_Insert()
6968
public class DB : DbContext
7069
{
7170
public DB()
72-
: base(new SqlCeConnection($"Data Source={Guid.NewGuid()}.sdf;Persist Security Info=False;"), contextOwnsConnection: true)
71+
: base(Effort.DbConnectionFactory.CreateTransient(), contextOwnsConnection: true)
7372
{
7473
Things.RemoveRange(Things);
7574
SaveChanges();

src/AutoMapper.Collection.EntityFramework/AutoMapper.Collection.EntityFramework.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>Collection updating support for EntityFramework with AutoMapper. Extends DBSet&lt;T&gt; with Persist&lt;TDto&gt;().InsertUpdate(dto) and Persist&lt;TDto&gt;().Delete(dto). Will find the matching object and will Insert/Update/Delete.</Description>
55
<Authors>Tyler Carlson</Authors>
6-
<TargetFramework>net461</TargetFramework>
6+
<TargetFrameworks>net461;netstandard2.1</TargetFrameworks>
77
<AssemblyName>AutoMapper.Collection.EntityFramework</AssemblyName>
88
<PackageId>AutoMapper.Collection.EntityFramework</PackageId>
99
<PackageIconUrl>https://s3.amazonaws.com/automapper/icon.png</PackageIconUrl>
@@ -23,9 +23,4 @@
2323
<PackageReference Include="EntityFramework" Version="$(EfVersion)" />
2424
</ItemGroup>
2525

26-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
27-
<Reference Include="System" />
28-
<Reference Include="Microsoft.CSharp" />
29-
</ItemGroup>
30-
3126
</Project>

0 commit comments

Comments
 (0)