Skip to content

Commit bdf002a

Browse files
committed
Merge branch 'dev' (3.2.0)
2 parents ccf3aa8 + 2d783a9 commit bdf002a

Some content is hidden

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

50 files changed

+2763
-3795
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ artifacts/
1818
*.lock.json
1919
.build
2020
TestResult.xml
21+
.vs/

.teamcity/EntityFramework6Npgsql/buildTypes/EntityFramework6Npgsql_Build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<param name="nuget.pack.properties" value="Configuration=Release" />
108108
<param name="nuget.pack.specFile"><![CDATA[src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.nuspec
109109
src/EntityFramework5.Npgsql/EntityFramework5.Npgsql.nuspec]]></param>
110+
<param name="nuget.pack.version" value="%build.number%" />
110111
<param name="nuget.path" value="?NuGet.CommandLine.DEFAULT" />
111112
<param name="nugetCustomPath" value="?NuGet.CommandLine.DEFAULT" />
112113
<param name="nugetPathSelector" value="?NuGet.CommandLine.DEFAULT" />

EntityFramework6.Npgsql.sln

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2035
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4A5A60DD-41B6-40BF-B677-227A921ECCC8}"
77
ProjectSection(SolutionItems) = preProject
8-
CommonAssemblyInfo.cs = CommonAssemblyInfo.cs
98
Npgsql.snk = Npgsql.snk
109
EndProjectSection
1110
EndProject
1211
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}"
1312
EndProject
1413
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{ED612DB1-AB32-4603-95E7-891BACA71C39}"
1514
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework6.Npgsql", "src\EntityFramework6.Npgsql\EntityFramework6.Npgsql.csproj", "{3EC85CBA-5B79-11E3-8104-0022198AB089}"
15+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFramework6.Npgsql", "src\EntityFramework6.Npgsql\EntityFramework6.Npgsql.csproj", "{3EC85CBA-5B79-11E3-8104-0022198AB089}"
1716
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework5.Npgsql", "src\EntityFramework5.Npgsql\EntityFramework5.Npgsql.csproj", "{100998C4-5B85-11E3-911C-0022198AB089}"
19-
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework6.Npgsql.Tests", "test\EntityFramework6.Npgsql.Tests\EntityFramework6.Npgsql.Tests.csproj", "{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}"
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFramework6.Npgsql.Tests", "test\EntityFramework6.Npgsql.Tests\EntityFramework6.Npgsql.Tests.csproj", "{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}"
2118
EndProject
2219
Global
2320
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,10 +26,6 @@ Global
2926
{3EC85CBA-5B79-11E3-8104-0022198AB089}.Debug|Any CPU.Build.0 = Debug|Any CPU
3027
{3EC85CBA-5B79-11E3-8104-0022198AB089}.Release|Any CPU.ActiveCfg = Release|Any CPU
3128
{3EC85CBA-5B79-11E3-8104-0022198AB089}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{100998C4-5B85-11E3-911C-0022198AB089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{100998C4-5B85-11E3-911C-0022198AB089}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{100998C4-5B85-11E3-911C-0022198AB089}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{100998C4-5B85-11E3-911C-0022198AB089}.Release|Any CPU.Build.0 = Release|Any CPU
3629
{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3730
{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
3831
{4A0A42DE-C8B8-11E4-8EC9-005056A163A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -43,9 +36,11 @@ Global
4336
EndGlobalSection
4437
GlobalSection(NestedProjects) = preSolution
4538
{3EC85CBA-5B79-11E3-8104-0022198AB089} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
46-
{100998C4-5B85-11E3-911C-0022198AB089} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
4739
{4A0A42DE-C8B8-11E4-8EC9-005056A163A4} = {ED612DB1-AB32-4603-95E7-891BACA71C39}
4840
EndGlobalSection
41+
GlobalSection(ExtensibilityGlobals) = postSolution
42+
SolutionGuid = {84B4C9EA-ED4F-4E87-8809-297958315622}
43+
EndGlobalSection
4944
GlobalSection(MonoDevelopProperties) = preSolution
5045
StartupItem = Npgsql.csproj
5146
EndGlobalSection

EntityFramework6.Npgsql.sln.DotSettings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<s:Boolean x:Key="/Default/CodeInspection/ImplicitNullability/Enabled/@EntryValue">True</s:Boolean>
33
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String>
44
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_CASE_FROM_SWITCH/@EntryValue">False</s:Boolean>
5+
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
56
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
67
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
78
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GSS/@EntryIndexedValue">GSS</s:String>
@@ -53,6 +54,11 @@
5354
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
5455
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
5556
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
57+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
58+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
59+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
60+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
5661
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
62+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
5763
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
5864
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Copyright (c) 2002-2018, Npgsql
2+
3+
Permission to use, copy, modify, and distribute this software and its
4+
documentation for any purpose, without fee, and without a written agreement
5+
is hereby granted, provided that the above copyright notice and this
6+
paragraph and the following two paragraphs appear in all copies.
7+
8+
IN NO EVENT SHALL NPGSQL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
9+
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
10+
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
11+
Npgsql HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+
13+
NPGSQL SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
14+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15+
PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND Npgsql
16+
HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
17+
OR MODIFICATIONS.

LICENSE.txt

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

bump.sh

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

doc/index.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,61 @@ In PostgreSQL, this implicitly uses `template1` as the template - anything exist
3232
be copied to your new database. If you wish to change the database used as a template, you can specify
3333
the `EF Template Database` connection string parameter. For more info see the
3434
[PostgreSQL docs](https://www.postgresql.org/docs/current/static/sql-createdatabase.html).
35+
36+
## Customizing DataReader Behavior ##
37+
38+
You can use [an Entity Framework 6 IDbCommandInterceptor](https://msdn.microsoft.com/en-us/library/dn469464(v=vs.113).aspx) to wrap the `DataReader` instance returned by Npgsql when Entity Framework executes queries. This is possible using a ```DbConfiguration``` class.
39+
40+
Example use cases:
41+
- Forcing all returned ```DateTime``` and ```DateTimeOffset``` values to be in the UTC timezone.
42+
- Preventing accidental insertion of DateTime values having ```DateTimeKind.Unspecified```.
43+
- Forcing all postgres date/time types to be returned to Entity Framework as ```DateTimeOffset```.
44+
45+
```c#
46+
[DbConfigurationType(typeof(AppDbContextConfiguration))]
47+
public class AppDbContext : DbContext
48+
{
49+
// ...
50+
}
51+
52+
public class AppDbContextConfiguration : DbConfiguration
53+
{
54+
public AppDbContextConfiguration()
55+
{
56+
this.AddInterceptor(new MyEntityFrameworkInterceptor());
57+
}
58+
}
59+
60+
class MyEntityFrameworkInterceptor : DbCommandInterceptor
61+
{
62+
public override void ReaderExecuted(
63+
DbCommand command,
64+
DbCommandInterceptionContext<DbDataReader> interceptionContext)
65+
{
66+
if (interceptionContext.Result == null) return;
67+
interceptionContext.Result = new WrappingDbDataReader(interceptionContext.Result);
68+
}
69+
70+
public override void ScalarExecuted(
71+
DbCommand command,
72+
DbCommandInterceptionContext<object> interceptionContext)
73+
{
74+
interceptionContext.Result = ModifyReturnValues(interceptionContext.Result);
75+
}
76+
77+
static object ModifyReturnValues(object result)
78+
{
79+
// Transform and then
80+
return result;
81+
}
82+
}
83+
84+
class WrappingDbDataReader : DbDataReader, IDataReader
85+
{
86+
// Wrap an existing DbDataReader, proxy all calls to the underlying instance,
87+
// modify return values and/or parameters as needed...
88+
public WrappingDbDataReader(DbDataReader reader)
89+
{
90+
}
91+
}
92+
```

src/CommonAssemblyInfo.cs

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

src/EntityFramework5.Npgsql/App.config

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

0 commit comments

Comments
 (0)