Skip to content

Commit 1c7db37

Browse files
committed
divided EF5 and EF6 projects
1 parent 2067358 commit 1c7db37

Some content is hidden

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

42 files changed

+1215
-179
lines changed

GeoJSON4EntityFramework.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GeoJSON4EntityFramework", "
77
EndProject
88
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestProject", "TestProject\TestProject.vbproj", "{3AA1813C-601C-4FFF-8F7A-7070649CAF65}"
99
EndProject
10+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GeoJSON4EntityFramework5", "GeoJSON4EntityFramework5\GeoJSON4EntityFramework5.vbproj", "{3622D159-0C66-4208-89FD-8DCD782B96F5}"
11+
EndProject
12+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestProjectEF5", "TestProjectEF5\TestProjectEF5.vbproj", "{F6B54320-5B5C-4ABF-A691-C3221641F353}"
13+
EndProject
1014
Global
1115
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1216
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +25,14 @@ Global
2125
{3AA1813C-601C-4FFF-8F7A-7070649CAF65}.Debug|Any CPU.Build.0 = Release|Any CPU
2226
{3AA1813C-601C-4FFF-8F7A-7070649CAF65}.Release|Any CPU.ActiveCfg = Release|Any CPU
2327
{3AA1813C-601C-4FFF-8F7A-7070649CAF65}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{3622D159-0C66-4208-89FD-8DCD782B96F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{3622D159-0C66-4208-89FD-8DCD782B96F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{3622D159-0C66-4208-89FD-8DCD782B96F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{3622D159-0C66-4208-89FD-8DCD782B96F5}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{F6B54320-5B5C-4ABF-A691-C3221641F353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{F6B54320-5B5C-4ABF-A691-C3221641F353}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{F6B54320-5B5C-4ABF-A691-C3221641F353}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{F6B54320-5B5C-4ABF-A691-C3221641F353}.Release|Any CPU.Build.0 = Release|Any CPU
2436
EndGlobalSection
2537
GlobalSection(SolutionProperties) = preSolution
2638
HideSolutionNode = FALSE
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
Public MustInherit Class GeoJsonGeometry(Of T)
22
Inherits GeoJsonElement(Of T)
33

4-
Public MustOverride Sub CreateFromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry)
5-
6-
Public MustOverride Sub CreateFromDbGeometry(inp As System.Data.Spatial.DbGeometry)
7-
84
<JsonProperty(PropertyName:="coordinates")>
95
Public MustOverride ReadOnly Property Coordinates() As Object
106

11-
Public Shared Function FromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry) As GeoJsonGeometry(Of T)
12-
Dim obj As GeoJsonGeometry(Of T) = CTypeDynamic(Activator.CreateInstance(Of T)(), GetType(T))
13-
obj.CreateFromDbGeometry(inp)
14-
Return obj
15-
End Function
16-
17-
Public Shared Function FromDbGeometry(inp As System.Data.Spatial.DbGeometry) As GeoJsonGeometry(Of T)
18-
Dim obj As GeoJsonGeometry(Of T) = CTypeDynamic(Activator.CreateInstance(Of T)(), GetType(T))
19-
obj.CreateFromDbGeometry(inp)
20-
Return obj
21-
End Function
227
End Class
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Partial MustInherit Class GeoJsonGeometry(Of T)
2+
Inherits GeoJsonElement(Of T)
3+
4+
Public MustOverride Sub CreateFromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry)
5+
6+
Public Shared Function FromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry) As GeoJsonGeometry(Of T)
7+
Dim obj As GeoJsonGeometry(Of T) = CTypeDynamic(Activator.CreateInstance(Of T)(), GetType(T))
8+
obj.CreateFromDbGeometry(inp)
9+
Return obj
10+
End Function
11+
End Class

GeoJSON4EntityFramework/Elements/Feature.vb

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,4 @@
1818
MyBase.New()
1919
Geometry = Geometries.ToList
2020
End Sub
21-
22-
Public Shared Function FromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry) As Feature
23-
Dim f As New Feature
24-
25-
Select Case inp.SpatialTypeName
26-
Case "MultiPolygon"
27-
f.Geometry.Add(MultiPolygon.FromDbGeometry(inp))
28-
Case "Polygon"
29-
f.Geometry.Add(Polygon.FromDbGeometry(inp))
30-
Case "Point"
31-
f.Geometry.Add(Point.FromDbGeometry(inp))
32-
Case "MultPoint"
33-
f.Geometry.Add(MultiPoint.FromDbGeometry(inp))
34-
Case Else
35-
Throw New NotImplementedException
36-
End Select
37-
38-
Return f
39-
End Function
40-
41-
Public Shared Function FromDbGeometry(inp As System.Data.Spatial.DbGeometry) As Feature
42-
Dim f As New Feature
43-
44-
Select Case inp.SpatialTypeName
45-
Case "MultiPolygon"
46-
f.Geometry.Add(MultiPolygon.FromDbGeometry(inp))
47-
Case "Polygon"
48-
f.Geometry.Add(Polygon.FromDbGeometry(inp))
49-
Case "Point"
50-
f.Geometry.Add(Point.FromDbGeometry(inp))
51-
Case "MultPoint"
52-
f.Geometry.Add(MultiPoint.FromDbGeometry(inp))
53-
Case Else
54-
Throw New NotImplementedException
55-
End Select
56-
57-
Return f
58-
End Function
5921
End Class
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Partial Class Feature
2+
3+
Public Shared Function FromDbGeometry(inp As System.Data.Entity.Spatial.DbGeometry) As Feature
4+
Dim f As New Feature
5+
6+
Select Case inp.SpatialTypeName
7+
Case "MultiPolygon"
8+
f.Geometry.Add(MultiPolygon.FromDbGeometry(inp))
9+
Case "Polygon"
10+
f.Geometry.Add(Polygon.FromDbGeometry(inp))
11+
Case "Point"
12+
f.Geometry.Add(Point.FromDbGeometry(inp))
13+
Case "MultPoint"
14+
f.Geometry.Add(MultiPoint.FromDbGeometry(inp))
15+
Case Else
16+
Throw New NotImplementedException
17+
End Select
18+
19+
Return f
20+
End Function
21+
End Class

GeoJSON4EntityFramework/Elements/MultiPoint.vb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,4 @@
1818
End If
1919
End Get
2020
End Property
21-
22-
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry)
23-
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException
24-
Points.Clear()
25-
26-
For i As Integer = 1 To inp.ElementCount
27-
Dim element = inp.ElementAt(i)
28-
If element.SpatialTypeName <> "Point" Then Throw New ArgumentException
29-
Points.Add(Point.FromDbGeometry(element))
30-
Next
31-
End Sub
32-
33-
Public Overloads Overrides Sub CreateFromDbGeometry(inp As Spatial.DbGeometry)
34-
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException
35-
Points.Clear()
36-
37-
For i As Integer = 1 To inp.ElementCount
38-
Dim element = inp.ElementAt(i)
39-
If element.SpatialTypeName <> "Point" Then Throw New ArgumentException
40-
Points.Add(Point.FromDbGeometry(element))
41-
Next
42-
End Sub
4321
End Class
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Partial Class MultiPoint
2+
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry)
3+
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException
4+
Points.Clear()
5+
6+
For i As Integer = 1 To inp.ElementCount
7+
Dim element = inp.ElementAt(i)
8+
If element.SpatialTypeName <> "Point" Then Throw New ArgumentException
9+
Points.Add(Point.FromDbGeometry(element))
10+
Next
11+
End Sub
12+
End Class

GeoJSON4EntityFramework/Elements/MultiPolygon.vb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,4 @@
1919
End If
2020
End Get
2121
End Property
22-
23-
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry)
24-
If inp.SpatialTypeName <> "MultiPolygon" Then Throw New ArgumentException
25-
Polygons.Clear()
26-
27-
For i As Integer = 1 To inp.ElementCount
28-
Dim element = inp.ElementAt(i)
29-
If element.SpatialTypeName <> "Polygon" Then Throw New ArgumentException
30-
Polygons.Add(Polygon.FromDbGeometry(element))
31-
Next
32-
End Sub
33-
34-
Public Overloads Overrides Sub CreateFromDbGeometry(inp As Spatial.DbGeometry)
35-
If inp.SpatialTypeName <> "MultiPolygon" Then Throw New ArgumentException
36-
Polygons.Clear()
37-
38-
For i As Integer = 1 To inp.ElementCount
39-
Dim element = inp.ElementAt(i)
40-
If element.SpatialTypeName <> "Polygon" Then Throw New ArgumentException
41-
Polygons.Add(Polygon.FromDbGeometry(element))
42-
Next
43-
End Sub
4422
End Class
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Partial Class MultiPolygon
2+
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry)
3+
If inp.SpatialTypeName <> "MultiPolygon" Then Throw New ArgumentException
4+
Polygons.Clear()
5+
6+
For i As Integer = 1 To inp.ElementCount
7+
Dim element = inp.ElementAt(i)
8+
If element.SpatialTypeName <> "Polygon" Then Throw New ArgumentException
9+
Polygons.Add(Polygon.FromDbGeometry(element))
10+
Next
11+
End Sub
12+
End Class

GeoJSON4EntityFramework/Elements/Point.vb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,4 @@
99
Return Point.Coordinate
1010
End Get
1111
End Property
12-
13-
Public Overrides Sub CreateFromDbGeometry(inp As Entity.Spatial.DbGeometry)
14-
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException
15-
Point = New Coordinate(inp.XCoordinate, inp.YCoordinate)
16-
End Sub
17-
18-
Public Overloads Overrides Sub CreateFromDbGeometry(inp As Spatial.DbGeometry)
19-
If inp.SpatialTypeName <> MyBase.TypeName Then Throw New ArgumentException
20-
Point = New Coordinate(inp.XCoordinate, inp.YCoordinate)
21-
End Sub
2212
End Class

0 commit comments

Comments
 (0)