Skip to content

Commit d7beea2

Browse files
committed
Reorganized Entity Framework support
- Reorganized the code into three projects/packages: 1) The Npgsql "core", fully functional ADO.NET and no EF 2) Npgsql.EntityFramework, an add-on for users of EF6 and above 3) Npgsql.EntityFrameworkLegacy, an add-on for users of EF5 and below - All EF-related code has been split off from Npgsql and into the Npgsql.EntityFramework directory - The same EF code is built via two projects: Npgsql.EntityFramework (defining ENTITIES6 for the new EF6), and Npgsql.EntityFrameworkLegacy (not defining it for pre-EF6). Still to be done: - Npgsql.NpgsqlFactory doesn't yet do the reflection work to return the pre-EF6 NpgsqlServices - Only the 2013 sln is up to date - nuspecs
1 parent 2f8928e commit d7beea2

File tree

264 files changed

+395
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+395
-143
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
/*.nupkg
88
[Bb]in/
99
[Bb]uild/
10-
/src/[Oo]bj/
11-
/tests/[Oo]bj/
10+
[Oo]bj/
11+
[Oo]bj/
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
using System;
1+
using System;
2+
using System.Runtime.CompilerServices;
23
using System.Security;
34
using System.Reflection;
45
using System.Resources;
56

6-
// ------------------------------------------------------------------------------
7-
// <autogenerated>
8-
// This code was generated by a tool.
9-
// Mono Runtime Version: 2.0.50727.1433
10-
//
11-
// Changes to this file may cause incorrect behavior and will be lost if
12-
// the code is regenerated.
13-
// </autogenerated>
14-
// ------------------------------------------------------------------------------
7+
// Contains assembly attributes shared by all Npgsql projects
158

169
[assembly: CLSCompliantAttribute(true)]
1710
[assembly: AllowPartiallyTrustedCallersAttribute()]
1811
#if NET40
1912
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
2013
#endif
21-
[assembly: AssemblyTitleAttribute("Npgsql - .Net Data Provider for PostgreSQL")]
22-
[assembly: AssemblyDescriptionAttribute(".Net Data Provider for PostgreSQL")]
2314
[assembly: AssemblyCompanyAttribute("Npgsql Development Team")]
2415
[assembly: AssemblyProductAttribute("Npgsql")]
2516
[assembly: AssemblyCopyrightAttribute("Copyright © 2002 - 2013 Npgsql Development Team")]
2617
[assembly: AssemblyTrademarkAttribute("")]
2718
[assembly: AssemblyVersionAttribute("2.1.0")]
2819
[assembly: AssemblyFileVersionAttribute("2.1.0")]
20+
[assembly: AssemblyInformationalVersionAttribute("2.1.0-beta1")]
2921
[assembly: NeutralResourcesLanguageAttribute("en", UltimateResourceFallbackLocation.MainAssembly)]
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{3EC85CBA-5B79-11E3-8104-0022198AB089}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<AssemblyName>Npgsql.EntityFramework</AssemblyName>
12+
<FileAlignment>512</FileAlignment>
13+
<SignAssembly>true</SignAssembly>
14+
<AssemblyOriginatorKeyFile>..\Npgsql.snk</AssemblyOriginatorKeyFile>
15+
<FileUpgradeFlags>
16+
</FileUpgradeFlags>
17+
<OldToolsVersion>3.5</OldToolsVersion>
18+
<UpgradeBackupLocation />
19+
<TargetFrameworkProfile />
20+
<PublishUrl>publish\</PublishUrl>
21+
<Install>true</Install>
22+
<InstallFrom>Disk</InstallFrom>
23+
<UpdateEnabled>false</UpdateEnabled>
24+
<UpdateMode>Foreground</UpdateMode>
25+
<UpdateInterval>7</UpdateInterval>
26+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
27+
<UpdatePeriodically>false</UpdatePeriodically>
28+
<UpdateRequired>false</UpdateRequired>
29+
<MapFileExtensions>true</MapFileExtensions>
30+
<ApplicationRevision>0</ApplicationRevision>
31+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
32+
<IsWebBootstrapper>false</IsWebBootstrapper>
33+
<UseApplicationTrust>false</UseApplicationTrust>
34+
<BootstrapperEnabled>true</BootstrapperEnabled>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net45|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>full</DebugType>
39+
<Optimize>false</Optimize>
40+
<OutputPath>bin\Debug-net45\</OutputPath>
41+
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;NET45;ENTITIES6</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
<DocumentationFile>bin\Debug-net45\Npgsql.EntityFramework.xml</DocumentationFile>
45+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
46+
</PropertyGroup>
47+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU' ">
48+
<DebugType>pdbonly</DebugType>
49+
<Optimize>true</Optimize>
50+
<OutputPath>bin\Release-net45\</OutputPath>
51+
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;NET45;ENTITIES6</DefineConstants>
52+
<ErrorReport>prompt</ErrorReport>
53+
<WarningLevel>4</WarningLevel>
54+
<DocumentationFile>bin\Release-net45\Npgsql.EntityFramework.xml</DocumentationFile>
55+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
56+
</PropertyGroup>
57+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net40|AnyCPU' ">
58+
<DebugSymbols>true</DebugSymbols>
59+
<DebugType>full</DebugType>
60+
<Optimize>false</Optimize>
61+
<OutputPath>bin\Debug-net40\</OutputPath>
62+
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;ENTITIES6</DefineConstants>
63+
<ErrorReport>prompt</ErrorReport>
64+
<WarningLevel>4</WarningLevel>
65+
<DocumentationFile>bin\Debug-net40\Npgsql.EntityFramework.xml</DocumentationFile>
66+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
67+
</PropertyGroup>
68+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU' ">
69+
<DebugType>pdbonly</DebugType>
70+
<Optimize>true</Optimize>
71+
<OutputPath>bin\Release-net40\</OutputPath>
72+
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;ENTITIES6</DefineConstants>
73+
<ErrorReport>prompt</ErrorReport>
74+
<WarningLevel>4</WarningLevel>
75+
<DocumentationFile>bin\Release-net40\Npgsql.EntityFramework.xml</DocumentationFile>
76+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
77+
</PropertyGroup>
78+
<ItemGroup>
79+
<Reference Include="EntityFramework">
80+
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.dll</HintPath>
81+
</Reference>
82+
<Reference Include="EntityFramework.SqlServer">
83+
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
84+
</Reference>
85+
<Reference Include="System" />
86+
<Reference Include="System.Core" />
87+
<Reference Include="System.Data" />
88+
<Reference Include="System.Transactions" />
89+
<Reference Include="System.Configuration" />
90+
<Reference Include="System.Xml" />
91+
<Reference Include="System.ComponentModel.DataAnnotations" />
92+
</ItemGroup>
93+
<ItemGroup>
94+
<EmbeddedResource Include="NpgsqlSchema.msl" />
95+
<EmbeddedResource Include="NpgsqlSchema.ssdl" />
96+
<EmbeddedResource Include="NpgsqlProviderManifest.Manifest.xml" />
97+
<None Include="packages.config" />
98+
</ItemGroup>
99+
<ItemGroup>
100+
<Compile Include="NpgsqlServices.cs" />
101+
<Compile Include="NpgsqlProviderManifest.cs" />
102+
<Compile Include="Properties\AssemblyInfo.cs" />
103+
<Compile Include="SqlGenerators\SqlBaseGenerator.cs" />
104+
<Compile Include="SqlGenerators\SqlDeleteGenerator.cs" />
105+
<Compile Include="SqlGenerators\SqlInsertGenerator.cs" />
106+
<Compile Include="SqlGenerators\SqlSelectGenerator.cs" />
107+
<Compile Include="SqlGenerators\SqlUpdateGenerator.cs" />
108+
<Compile Include="SqlGenerators\VisitedExpression.cs" />
109+
<Compile Include="..\CommonAssemblyInfo.cs">
110+
<Link>Properties\CommonAssemblyInfo.cs</Link>
111+
<SubType>Code</SubType>
112+
</Compile>
113+
</ItemGroup>
114+
<ItemGroup>
115+
<ProjectReference Include="..\Npgsql\Npgsql.csproj">
116+
<Project>{9d13b739-62b1-4190-b386-7a9547304eb3}</Project>
117+
<Name>Npgsql</Name>
118+
</ProjectReference>
119+
</ItemGroup>
120+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
121+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{100998C4-5B85-11E3-911C-0022198AB089}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<AssemblyName>Npgsql.EntityFrameworkLegacy</AssemblyName>
12+
<FileAlignment>512</FileAlignment>
13+
<SignAssembly>true</SignAssembly>
14+
<AssemblyOriginatorKeyFile>..\Npgsql.snk</AssemblyOriginatorKeyFile>
15+
<FileUpgradeFlags>
16+
</FileUpgradeFlags>
17+
<OldToolsVersion>3.5</OldToolsVersion>
18+
<UpgradeBackupLocation />
19+
<TargetFrameworkProfile />
20+
<PublishUrl>publish\</PublishUrl>
21+
<Install>true</Install>
22+
<InstallFrom>Disk</InstallFrom>
23+
<UpdateEnabled>false</UpdateEnabled>
24+
<UpdateMode>Foreground</UpdateMode>
25+
<UpdateInterval>7</UpdateInterval>
26+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
27+
<UpdatePeriodically>false</UpdatePeriodically>
28+
<UpdateRequired>false</UpdateRequired>
29+
<MapFileExtensions>true</MapFileExtensions>
30+
<ApplicationRevision>0</ApplicationRevision>
31+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
32+
<IsWebBootstrapper>false</IsWebBootstrapper>
33+
<UseApplicationTrust>false</UseApplicationTrust>
34+
<BootstrapperEnabled>true</BootstrapperEnabled>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net45|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>full</DebugType>
39+
<Optimize>false</Optimize>
40+
<OutputPath>bin\Legacy-Debug-net45\</OutputPath>
41+
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;NET45</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
<DocumentationFile>bin\Legacy-Debug-net45\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
45+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
46+
</PropertyGroup>
47+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU' ">
48+
<DebugType>pdbonly</DebugType>
49+
<Optimize>true</Optimize>
50+
<OutputPath>bin\Legacy-Release-net45\</OutputPath>
51+
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;NET45</DefineConstants>
52+
<ErrorReport>prompt</ErrorReport>
53+
<WarningLevel>4</WarningLevel>
54+
<DocumentationFile>bin\Legacy-Release-net45\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
55+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
56+
</PropertyGroup>
57+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net40|AnyCPU' ">
58+
<DebugSymbols>true</DebugSymbols>
59+
<DebugType>full</DebugType>
60+
<Optimize>false</Optimize>
61+
<OutputPath>bin\Legacy-Debug-net40\</OutputPath>
62+
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40</DefineConstants>
63+
<ErrorReport>prompt</ErrorReport>
64+
<WarningLevel>4</WarningLevel>
65+
<DocumentationFile>bin\Legacy-Debug-net40\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
66+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
67+
</PropertyGroup>
68+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU' ">
69+
<DebugType>pdbonly</DebugType>
70+
<Optimize>true</Optimize>
71+
<OutputPath>bin\Legacy-Release-net40\</OutputPath>
72+
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40</DefineConstants>
73+
<ErrorReport>prompt</ErrorReport>
74+
<WarningLevel>4</WarningLevel>
75+
<DocumentationFile>bin\Legacy-Release-net40\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
76+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
77+
</PropertyGroup>
78+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net35|AnyCPU' ">
79+
<DebugSymbols>true</DebugSymbols>
80+
<DebugType>full</DebugType>
81+
<Optimize>false</Optimize>
82+
<OutputPath>bin\Legacy-Debug-net35\</OutputPath>
83+
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35</DefineConstants>
84+
<ErrorReport>prompt</ErrorReport>
85+
<WarningLevel>4</WarningLevel>
86+
<DocumentationFile>bin\Legacy-Debug-net35\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
87+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
88+
</PropertyGroup>
89+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net35|AnyCPU' ">
90+
<DebugType>pdbonly</DebugType>
91+
<Optimize>true</Optimize>
92+
<OutputPath>bin\Legacy-Release-net35\</OutputPath>
93+
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35</DefineConstants>
94+
<ErrorReport>prompt</ErrorReport>
95+
<WarningLevel>4</WarningLevel>
96+
<DocumentationFile>bin\Legacy-Release-net35\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
97+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
98+
</PropertyGroup>
99+
<ItemGroup>
100+
<Reference Include="System" />
101+
<Reference Include="System.Core" />
102+
<Reference Include="System.Data" />
103+
<Reference Include="System.Data.Entity" />
104+
<Reference Include="System.Transactions" />
105+
<Reference Include="System.Configuration" />
106+
<Reference Include="System.Xml" />
107+
<Reference Include="System.ComponentModel.DataAnnotations" />
108+
</ItemGroup>
109+
<ItemGroup>
110+
<EmbeddedResource Include="NpgsqlSchema.msl" />
111+
<EmbeddedResource Include="NpgsqlSchema.ssdl" />
112+
<EmbeddedResource Include="NpgsqlProviderManifest.Manifest.xml" />
113+
<None Include="packages.config" />
114+
</ItemGroup>
115+
<ItemGroup>
116+
<Compile Include="NpgsqlServices.cs" />
117+
<Compile Include="NpgsqlProviderManifest.cs" />
118+
<Compile Include="Properties\AssemblyInfo.cs" />
119+
<Compile Include="SqlGenerators\SqlBaseGenerator.cs" />
120+
<Compile Include="SqlGenerators\SqlDeleteGenerator.cs" />
121+
<Compile Include="SqlGenerators\SqlInsertGenerator.cs" />
122+
<Compile Include="SqlGenerators\SqlSelectGenerator.cs" />
123+
<Compile Include="SqlGenerators\SqlUpdateGenerator.cs" />
124+
<Compile Include="SqlGenerators\VisitedExpression.cs" />
125+
<Compile Include="..\CommonAssemblyInfo.cs">
126+
<Link>Properties\CommonAssemblyInfo.cs</Link>
127+
<SubType>Code</SubType>
128+
</Compile>
129+
</ItemGroup>
130+
<ItemGroup>
131+
<Folder Include="Properties\" />
132+
</ItemGroup>
133+
<ItemGroup>
134+
<ProjectReference Include="..\Npgsql\Npgsql.csproj">
135+
<Project>{9d13b739-62b1-4190-b386-7a9547304eb3}</Project>
136+
<Name>Npgsql</Name>
137+
</ProjectReference>
138+
</ItemGroup>
139+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
140+
</Project>

src/Npgsql/NpgsqlProviderManifest.cs Npgsql.EntityFramework/NpgsqlProviderManifest.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Text;
54
using System.Data.Common;
@@ -285,4 +284,3 @@ public override string EscapeLikeArgument(string argument)
285284

286285
}
287286
}
288-
#endif
File renamed without changes.
File renamed without changes.

src/Npgsql/NpgsqlServices.cs Npgsql.EntityFramework/NpgsqlServices.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Data.Common;
54
using System.Xml;
@@ -114,5 +113,3 @@ protected override DbProviderManifest GetDbProviderManifest(string versionHint)
114113
}
115114
}
116115
}
117-
118-
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Runtime.CompilerServices;
3+
using System.Security;
4+
using System.Reflection;
5+
using System.Resources;
6+
7+
// Additional assembly attributes are defined in GlobalAssemblyInfo.cs
8+
9+
#if ENTITIES6
10+
[assembly: AssemblyTitleAttribute("Npgsql.EntityFramework")]
11+
[assembly: AssemblyDescriptionAttribute("Postgresql provider for Entity Framework 6 and above")]
12+
#else
13+
[assembly: AssemblyTitleAttribute("Npgsql.EntityFrameworkLegacy")]
14+
[assembly: AssemblyDescriptionAttribute("Postgresql provider for Entity Framework 5 and under")]
15+
#endif

src/Npgsql/SqlGenerators/SqlBaseGenerator.cs Npgsql.EntityFramework/SqlGenerators/SqlBaseGenerator.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Data.Common;
54
#if ENTITIES6
@@ -1338,4 +1337,3 @@ public override VisitedExpression Visit(DbPropertyExpression expression)
13381337
#endif
13391338
}
13401339
}
1341-
#endif

src/Npgsql/SqlGenerators/SqlDeleteGenerator.cs Npgsql.EntityFramework/SqlGenerators/SqlDeleteGenerator.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Data.Common;
54
#if ENTITIES6
@@ -42,4 +41,3 @@ public override void BuildCommand(DbCommand command)
4241
}
4342
}
4443
}
45-
#endif

src/Npgsql/SqlGenerators/SqlInsertGenerator.cs Npgsql.EntityFramework/SqlGenerators/SqlInsertGenerator.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Data.Common;
54
#if ENTITIES6
@@ -89,4 +88,3 @@ public override void BuildCommand(DbCommand command)
8988
}
9089
}
9190
}
92-
#endif

src/Npgsql/SqlGenerators/SqlSelectGenerator.cs Npgsql.EntityFramework/SqlGenerators/SqlSelectGenerator.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if ENTITIES
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Data.Common;
54
#if ENTITIES6
@@ -58,4 +57,3 @@ public override void BuildCommand(DbCommand command)
5857
}
5958
}
6059
}
61-
#endif

0 commit comments

Comments
 (0)