I invite you to take a look at this forum post from 'Benys'

It illustrates the power of the Entity Framework's mapping capabilities + partial classes.

The short answer to a lot of "Does the EF support ... ?" type questions is often no. 

Often however the longer answer, is a little easier to digest.

If you start using the power of DefiningQueries / Partial Classes / View / Stored Procs suddenly lots of things become possible.

The nice thing about 'Benys' example is that while UDTs ( spatial types are basically UDTs ) are not natively supported by the Entity Framework, there is a nice work around...

Here is the pattern:

  1. Define your Entity with Binary properties rather than UDT properties
  2. Create a DefiningQuery in your SSDL that uses T-SQL to convert from the UDT to binary.
  3. In the partial class add a property that goes from binary back to you UDT in memory.

The are a few caveats of course*, but this is just the sort of work-around that allows you to handle an issue that might otherwise be a real show-stopper.

* Issues (non exhaustive list)

  • The property you define in your partial class can't be used in a query
  • You can't make use of a UDT's operations in a query
  • The extra step of materializing twice (the Binary + the UDT) makes it a little slower
  • You have to keep your partial class properties and the entity properties in sync