Skip to content

Commit 3a086d2

Browse files
committed
CoreCLR and project.json work
1 parent 5f3eadf commit 3a086d2

29 files changed

Lines changed: 625 additions & 259 deletions

Npgsql-dnx.sln

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
EndProject
1414
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Npgsql", "src\Npgsql\Npgsql.xproj", "{9D13B739-62B1-4190-B386-7A9547304EB3}"
1515
EndProject
16-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework7.Npgsql", "src\EntityFramework7.Npgsql\EntityFramework7.Npgsql.xproj", "{8FD04E24-CDDF-41CA-940D-2021BD62FB87}"
17-
EndProject
1816
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{802E669C-6885-4E60-9CFB-8CFB47EAF16A}"
1917
EndProject
2018
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Npgsql.Tests", "test\Npgsql.Tests\Npgsql.Tests.xproj", "{E9C258D7-0D8E-4E6A-9857-5C6438591755}"
2119
EndProject
22-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework7.Npgsql.FunctionalTests", "test\EntityFramework7.Npgsql.FunctionalTests\EntityFramework7.Npgsql.FunctionalTests.xproj", "{57133FED-98D5-4A73-8D88-779A19214A68}"
20+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework7.Npgsql", "src\EntityFramework7.Npgsql\EntityFramework7.Npgsql.xproj", "{51AA8838-1F44-49DF-A02F-AA56A0944B53}"
21+
EndProject
22+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework7.Npgsql.FunctionalTests", "test\EntityFramework7.Npgsql.FunctionalTests\EntityFramework7.Npgsql.FunctionalTests.xproj", "{F33996A5-AAB6-4EC0-A865-E80AD16F3163}"
23+
EndProject
24+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework7.Npgsql.Tests", "test\EntityFramework7.Npgsql.Tests\EntityFramework7.Npgsql.Tests.xproj", "{0F64B74C-8869-4352-9AF5-A4BF0927BCF1}"
25+
EndProject
26+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFramework6.Npgsql", "src\EntityFramework6.Npgsql\EntityFramework6.Npgsql.xproj", "{4F808F64-18DB-4E91-A295-6FDB88893852}"
2327
EndProject
2428
Global
2529
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -31,26 +35,36 @@ Global
3135
{9D13B739-62B1-4190-B386-7A9547304EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
3236
{9D13B739-62B1-4190-B386-7A9547304EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
3337
{9D13B739-62B1-4190-B386-7A9547304EB3}.Release|Any CPU.Build.0 = Release|Any CPU
34-
{8FD04E24-CDDF-41CA-940D-2021BD62FB87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35-
{8FD04E24-CDDF-41CA-940D-2021BD62FB87}.Debug|Any CPU.Build.0 = Debug|Any CPU
36-
{8FD04E24-CDDF-41CA-940D-2021BD62FB87}.Release|Any CPU.ActiveCfg = Release|Any CPU
37-
{8FD04E24-CDDF-41CA-940D-2021BD62FB87}.Release|Any CPU.Build.0 = Release|Any CPU
3838
{E9C258D7-0D8E-4E6A-9857-5C6438591755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3939
{E9C258D7-0D8E-4E6A-9857-5C6438591755}.Debug|Any CPU.Build.0 = Debug|Any CPU
4040
{E9C258D7-0D8E-4E6A-9857-5C6438591755}.Release|Any CPU.ActiveCfg = Release|Any CPU
4141
{E9C258D7-0D8E-4E6A-9857-5C6438591755}.Release|Any CPU.Build.0 = Release|Any CPU
42-
{57133FED-98D5-4A73-8D88-779A19214A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43-
{57133FED-98D5-4A73-8D88-779A19214A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
44-
{57133FED-98D5-4A73-8D88-779A19214A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
45-
{57133FED-98D5-4A73-8D88-779A19214A68}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{51AA8838-1F44-49DF-A02F-AA56A0944B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43+
{51AA8838-1F44-49DF-A02F-AA56A0944B53}.Debug|Any CPU.Build.0 = Debug|Any CPU
44+
{51AA8838-1F44-49DF-A02F-AA56A0944B53}.Release|Any CPU.ActiveCfg = Release|Any CPU
45+
{51AA8838-1F44-49DF-A02F-AA56A0944B53}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{F33996A5-AAB6-4EC0-A865-E80AD16F3163}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{F33996A5-AAB6-4EC0-A865-E80AD16F3163}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{F33996A5-AAB6-4EC0-A865-E80AD16F3163}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{F33996A5-AAB6-4EC0-A865-E80AD16F3163}.Release|Any CPU.Build.0 = Release|Any CPU
50+
{0F64B74C-8869-4352-9AF5-A4BF0927BCF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{0F64B74C-8869-4352-9AF5-A4BF0927BCF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{0F64B74C-8869-4352-9AF5-A4BF0927BCF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
53+
{0F64B74C-8869-4352-9AF5-A4BF0927BCF1}.Release|Any CPU.Build.0 = Release|Any CPU
54+
{4F808F64-18DB-4E91-A295-6FDB88893852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{4F808F64-18DB-4E91-A295-6FDB88893852}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{4F808F64-18DB-4E91-A295-6FDB88893852}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{4F808F64-18DB-4E91-A295-6FDB88893852}.Release|Any CPU.Build.0 = Release|Any CPU
4658
EndGlobalSection
4759
GlobalSection(SolutionProperties) = preSolution
4860
HideSolutionNode = FALSE
4961
EndGlobalSection
5062
GlobalSection(NestedProjects) = preSolution
5163
{9D13B739-62B1-4190-B386-7A9547304EB3} = {8A657AC5-150F-4F55-8D9E-4F1A56D62D60}
52-
{8FD04E24-CDDF-41CA-940D-2021BD62FB87} = {8A657AC5-150F-4F55-8D9E-4F1A56D62D60}
5364
{E9C258D7-0D8E-4E6A-9857-5C6438591755} = {802E669C-6885-4E60-9CFB-8CFB47EAF16A}
54-
{57133FED-98D5-4A73-8D88-779A19214A68} = {802E669C-6885-4E60-9CFB-8CFB47EAF16A}
65+
{51AA8838-1F44-49DF-A02F-AA56A0944B53} = {8A657AC5-150F-4F55-8D9E-4F1A56D62D60}
66+
{F33996A5-AAB6-4EC0-A865-E80AD16F3163} = {802E669C-6885-4E60-9CFB-8CFB47EAF16A}
67+
{0F64B74C-8869-4352-9AF5-A4BF0927BCF1} = {802E669C-6885-4E60-9CFB-8CFB47EAF16A}
68+
{4F808F64-18DB-4E91-A295-6FDB88893852} = {8A657AC5-150F-4F55-8D9E-4F1A56D62D60}
5569
EndGlobalSection
5670
EndGlobal

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"sources": [ "src", "external/EntityFramework/src", "external/EntityFramework/test" ]
3-
}
2+
"sources": [ "src", "test" ]
3+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>4f808f64-18db-4e91-a295-6fdb88893852</ProjectGuid>
10+
<RootNamespace>EntityFramework6.Npgsql</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "3.1.0-alpha2",
3+
"authors": [
4+
"Shay Rojansky",
5+
"Emil Lenngren",
6+
"Francisco Figueiredo Jr.",
7+
"Kenji Uno",
8+
"Jon Asher",
9+
"Josh Cooley",
10+
"Federico Di Gregorio",
11+
"Jon Hanna",
12+
"Chris Morgan",
13+
"Dave Page",
14+
"Glen Parker",
15+
"Brar Piening",
16+
"Hiroshi Saito"
17+
],
18+
"description" : "PostgreSQL provider for Entity Framework 6",
19+
"dependencies" : {
20+
"EntityFramework": "6.1.3",
21+
"Npgsql": "3.1.0-alpha2",
22+
},
23+
"frameworks": {
24+
"net452": {
25+
"frameworkAssemblies": {
26+
"System.Collections": "4.0.0.0",
27+
"System.Data": "4.0.0.0",
28+
"System.Data.Entity": "4.0.0.0",
29+
"System.Reflection": "4.0.0.0",
30+
"System.Diagnostics.Contracts": "4.0.0.0",
31+
"System.Linq.Expressions": "4.0.0.0",
32+
"System.Runtime": "4.0.0.0",
33+
}
34+
},
35+
"dnx452": {
36+
"frameworkAssemblies": {
37+
"System.Collections": "4.0.0.0",
38+
"System.Data": "4.0.0.0",
39+
"System.Data.Entity": "4.0.0.0",
40+
"System.Reflection": "4.0.0.0",
41+
"System.Diagnostics.Contracts": "4.0.0.0",
42+
"System.Linq.Expressions": "4.0.0.0",
43+
"System.Runtime": "4.0.0.0",
44+
}
45+
}
46+
}
47+
}

src/EntityFramework7.Npgsql/EntityFramework7.Npgsql.xproj

100644100755
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
55
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
66
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
78
<PropertyGroup Label="Globals">
8-
<ProjectGuid>8FD04E24-CDDF-41CA-940D-2021BD62FB87</ProjectGuid>
9-
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
10-
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
9+
<ProjectGuid>51aa8838-1f44-49df-a02f-aa56a0944b53</ProjectGuid>
10+
<RootNamespace>EntityFramework7.Npgsql</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
1113
</PropertyGroup>
14+
1215
<PropertyGroup>
1316
<SchemaVersion>2.0</SchemaVersion>
1417
</PropertyGroup>
15-
<ProjectExtensions>
16-
<VisualStudio>
17-
<UserProperties project_1json__JSONSchema="http://www.asp.net/media/4878834/project.json" />
18-
</VisualStudio>
19-
</ProjectExtensions>
20-
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" />
21-
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" />
18+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
2219
</Project>

src/EntityFramework7.Npgsql/Query/Sql/NpgsqlQuerySqlGenerator.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ public override Expression VisitSum(SumExpression sumExpression)
8181
// In PostgreSQL SUM() doesn't return the same type as its argument for smallint, int and bigint.
8282
// Cast to get the same type.
8383
// http://www.postgresql.org/docs/current/static/functions-aggregate.html
84-
switch (Type.GetTypeCode(sumExpression.Expression.Type))
84+
if (sumExpression.Type == typeof(short))
8585
{
86-
case TypeCode.Int16:
87-
Sql.Append("::INT2");
88-
break;
89-
case TypeCode.Int32:
90-
Sql.Append("::INT4");
91-
break;
92-
case TypeCode.Int64:
93-
Sql.Append("::INT8");
94-
break;
86+
Sql.Append("::INT2");
87+
}
88+
else if (sumExpression.Type == typeof (int))
89+
{
90+
Sql.Append("::INT4");
91+
}
92+
else if (sumExpression.Type == typeof(long))
93+
{
94+
Sql.Append("::INT8");
9595
}
9696

9797
return sumExpression;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"version": "3.1.0-beta8-1",
3+
"authors": [
4+
"Shay Rojansky"
5+
],
6+
"description" : "PostgreSQL provider for Entity Framework 7",
7+
"dependencies" : {
8+
"EntityFramework.Core": "7.0.0-beta8-15723",
9+
"EntityFramework.Relational": "7.0.0-beta8-15723",
10+
"Microsoft.Framework.DependencyInjection": "1.0.0-*",
11+
"Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-*",
12+
"Npgsql": "3.1.0-alpha2",
13+
},
14+
"frameworks": {
15+
"net452": {
16+
"frameworkAssemblies": {
17+
"System.Collections": "4.0.0.0",
18+
"System.Reflection": "4.0.0.0",
19+
"System.Diagnostics.Contracts": "4.0.0.0",
20+
"System.Linq.Expressions": "4.0.0.0",
21+
"System.Runtime": "4.0.0.0",
22+
}
23+
},
24+
"dnx452": {
25+
"frameworkAssemblies": {
26+
"System.Collections": "4.0.0.0",
27+
"System.Reflection": "4.0.0.0",
28+
"System.Diagnostics.Contracts": "4.0.0.0",
29+
"System.Linq.Expressions": "4.0.0.0",
30+
"System.Runtime": "4.0.0.0",
31+
}
32+
},
33+
"dnxcore50": {
34+
"dependencies": {
35+
}
36+
}
37+
}
38+
}

src/Npgsql/BackendMessages/ErrorOrNoticeMessage.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323

2424
using System;
2525
using System.Diagnostics.Contracts;
26-
using System.Runtime.Serialization;
2726
using Npgsql.Logging;
27+
#if !DNXCORE50
28+
using System.Runtime.Serialization;
29+
#endif
2830

2931
namespace Npgsql.BackendMessages
3032
{
33+
#if !DNXCORE50
3134
[Serializable]
35+
#endif
3236
class ErrorOrNoticeMessage
3337
{
3438
static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();

src/Npgsql/BackendMessages/RowDescriptionMessage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ public bool Equals(string x, string y)
133133
}
134134
public int GetHashCode(string obj)
135135
{
136+
#if NET452
136137
return CompareInfo.GetSortKey(obj, CompareOptions.IgnoreWidth).GetHashCode();
138+
#else
139+
return CompareInfo.GetHashCode(obj, CompareOptions.IgnoreWidth);
140+
#endif
137141
}
138142
}
139143

@@ -147,7 +151,11 @@ public bool Equals(string x, string y)
147151
}
148152
public int GetHashCode(string obj)
149153
{
154+
#if NET452
150155
return CompareInfo.GetSortKey(obj, CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase).GetHashCode();
156+
#else
157+
return CompareInfo.GetHashCode(obj, CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase);
158+
#endif
151159
}
152160
}
153161

src/Npgsql/Logging/NpgsqlLogManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ static internal NpgsqlLogger GetCurrentClassLogger()
7171
// Copied from NLog
7272
static string GetClassFullName()
7373
{
74+
#if DNXCORE50
75+
return "<UNKNOWN>";
76+
#else
7477
string className;
7578
Type declaringType;
7679
int framesToSkip = 2;
@@ -93,6 +96,7 @@ static string GetClassFullName()
9396
} while (declaringType.Module.Name.Equals("mscorlib.dll", StringComparison.OrdinalIgnoreCase));
9497

9598
return className;
99+
#endif
96100
}
97101

98102
static NpgsqlLogManager()

0 commit comments

Comments
 (0)