I am using entity framework 6 for crud operations including a DbGeometry property. The property holds a polygon created from WellKnownText.
DbGeometry.PolygonFromText("POLYGON((1.00 1.00, 1.00 80.00, 80.00 80.00, 80.00 1.00, 1.00 1.00))", 27700);
When saving the entity binary data is stored in the spatial database. However when retrieving WellknownValue is being populated with the WellKnownText, however the Dbgeometry.WellKnownValue.WellKnownBinary property is null
(Would post image here but not enough reputation points :( )
Surely this should of been populated from the binary in the database. I have tried setting the field by the AsBinary() method with no success.
Thanks John but unfortunately this is not working either. I have tried:
Property.WellKnownValue.WellKnownBinary = Property.AsBinary();
which still leaves Property.WellKnownValue.WellKnownBinary as null using the QuickWatch window
Also I have tried
byte byteVariable = Property.AsBinary();
This does create a 93 byte long byte array I have pasted below, however this seems very empty for what it should contain.
If I then try to assign that byte array to the WellKnownBinary:
Property.WellKnownValue.WellKnownBinary = byteVariable
Property.WellKnownValue.WellKnownBinary is still shown as null using the QuickWatch window
I am seriously running out of ideas :(