Skip to content

Commit

Permalink
Reorganized Entity Framework support
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
roji committed Dec 3, 2013
1 parent 2f8928e commit d7beea2
Show file tree
Hide file tree
Showing 264 changed files with 395 additions and 143 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
/*.nupkg
[Bb]in/
[Bb]uild/
/src/[Oo]bj/
/tests/[Oo]bj/
[Oo]bj/
[Oo]bj/
17 changes: 5 additions & 12 deletions src/Npgsql/AssemblyInfo.cs → CommonAssemblyInfo.cs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
using System;
using System;
using System.Runtime.CompilerServices;
using System.Security;
using System.Reflection;
using System.Resources;

// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
// Contains assembly attributes shared by all Npgsql projects

[assembly: CLSCompliantAttribute(true)]
[assembly: AllowPartiallyTrustedCallersAttribute()]
#if NET40
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
#endif
[assembly: AssemblyTitleAttribute("Npgsql - .Net Data Provider for PostgreSQL")]
[assembly: AssemblyDescriptionAttribute(".Net Data Provider for PostgreSQL")]
[assembly: AssemblyCompanyAttribute("Npgsql Development Team")]
[assembly: AssemblyProductAttribute("Npgsql")]
[assembly: AssemblyCopyrightAttribute("Copyright © 2002 - 2013 Npgsql Development Team")]
[assembly: AssemblyTrademarkAttribute("")]
[assembly: AssemblyVersionAttribute("2.1.0")]
[assembly: AssemblyFileVersionAttribute("2.1.0")]
[assembly: AssemblyInformationalVersionAttribute("2.1.0-beta1")]
[assembly: NeutralResourcesLanguageAttribute("en", UltimateResourceFallbackLocation.MainAssembly)]

121 changes: 121 additions & 0 deletions Npgsql.EntityFramework/Npgsql.EntityFramework.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3EC85CBA-5B79-11E3-8104-0022198AB089}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Npgsql.EntityFramework</AssemblyName>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Npgsql.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net45|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug-net45\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;NET45;ENTITIES6</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug-net45\Npgsql.EntityFramework.xml</DocumentationFile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release-net45\</OutputPath>
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;NET45;ENTITIES6</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release-net45\Npgsql.EntityFramework.xml</DocumentationFile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net40|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug-net40\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;ENTITIES6</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug-net40\Npgsql.EntityFramework.xml</DocumentationFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release-net40\</OutputPath>
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;ENTITIES6</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release-net40\Npgsql.EntityFramework.xml</DocumentationFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer">
<HintPath>..\packages\EntityFramework.6.0.1\lib\net40\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Transactions" />
<Reference Include="System.Configuration" />
<Reference Include="System.Xml" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="NpgsqlSchema.msl" />
<EmbeddedResource Include="NpgsqlSchema.ssdl" />
<EmbeddedResource Include="NpgsqlProviderManifest.Manifest.xml" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="NpgsqlServices.cs" />
<Compile Include="NpgsqlProviderManifest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqlGenerators\SqlBaseGenerator.cs" />
<Compile Include="SqlGenerators\SqlDeleteGenerator.cs" />
<Compile Include="SqlGenerators\SqlInsertGenerator.cs" />
<Compile Include="SqlGenerators\SqlSelectGenerator.cs" />
<Compile Include="SqlGenerators\SqlUpdateGenerator.cs" />
<Compile Include="SqlGenerators\VisitedExpression.cs" />
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Npgsql\Npgsql.csproj">
<Project>{9d13b739-62b1-4190-b386-7a9547304eb3}</Project>
<Name>Npgsql</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
140 changes: 140 additions & 0 deletions Npgsql.EntityFramework/Npgsql.EntityFrameworkLegacy.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{100998C4-5B85-11E3-911C-0022198AB089}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Npgsql.EntityFrameworkLegacy</AssemblyName>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Npgsql.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net45|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Legacy-Debug-net45\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Debug-net45\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Legacy-Release-net45\</OutputPath>
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Release-net45\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net40|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Legacy-Debug-net40\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35;NET40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Debug-net40\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Legacy-Release-net40\</OutputPath>
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35;NET40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Release-net40\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-net35|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Legacy-Debug-net35\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS;UNMANAGED;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Debug-net35\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net35|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Legacy-Release-net35\</OutputPath>
<DefineConstants>TRACE;WINDOWS;UNMANAGED;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Legacy-Release-net35\Npgsql.EntityFrameworkLegacy.xml</DocumentationFile>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Transactions" />
<Reference Include="System.Configuration" />
<Reference Include="System.Xml" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="NpgsqlSchema.msl" />
<EmbeddedResource Include="NpgsqlSchema.ssdl" />
<EmbeddedResource Include="NpgsqlProviderManifest.Manifest.xml" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="NpgsqlServices.cs" />
<Compile Include="NpgsqlProviderManifest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqlGenerators\SqlBaseGenerator.cs" />
<Compile Include="SqlGenerators\SqlDeleteGenerator.cs" />
<Compile Include="SqlGenerators\SqlInsertGenerator.cs" />
<Compile Include="SqlGenerators\SqlSelectGenerator.cs" />
<Compile Include="SqlGenerators\SqlUpdateGenerator.cs" />
<Compile Include="SqlGenerators\VisitedExpression.cs" />
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Npgsql\Npgsql.csproj">
<Project>{9d13b739-62b1-4190-b386-7a9547304eb3}</Project>
<Name>Npgsql</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
Expand Down Expand Up @@ -285,4 +284,3 @@ public override string EscapeLikeArgument(string argument)

}
}
#endif
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Xml;
Expand Down Expand Up @@ -114,5 +113,3 @@ protected override DbProviderManifest GetDbProviderManifest(string versionHint)
}
}
}

#endif
15 changes: 15 additions & 0 deletions Npgsql.EntityFramework/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Runtime.CompilerServices;
using System.Security;
using System.Reflection;
using System.Resources;

// Additional assembly attributes are defined in GlobalAssemblyInfo.cs

#if ENTITIES6
[assembly: AssemblyTitleAttribute("Npgsql.EntityFramework")]
[assembly: AssemblyDescriptionAttribute("Postgresql provider for Entity Framework 6 and above")]
#else
[assembly: AssemblyTitleAttribute("Npgsql.EntityFrameworkLegacy")]
[assembly: AssemblyDescriptionAttribute("Postgresql provider for Entity Framework 5 and under")]
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Data.Common;
#if ENTITIES6
Expand Down Expand Up @@ -1338,4 +1337,3 @@ public override VisitedExpression Visit(DbPropertyExpression expression)
#endif
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Data.Common;
#if ENTITIES6
Expand Down Expand Up @@ -42,4 +41,3 @@ public override void BuildCommand(DbCommand command)
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Data.Common;
#if ENTITIES6
Expand Down Expand Up @@ -89,4 +88,3 @@ public override void BuildCommand(DbCommand command)
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ENTITIES
using System;
using System;
using System.Collections.Generic;
using System.Data.Common;
#if ENTITIES6
Expand Down Expand Up @@ -58,4 +57,3 @@ public override void BuildCommand(DbCommand command)
}
}
}
#endif
Loading

0 comments on commit d7beea2

Please sign in to comment.