This project has moved. For the latest updates, please go here.

Entities with EDM geography column failing

Aug 15, 2013 at 3:12 PM
I have an entity wchich is defined as follows in my EDMX (I removed most of the unnecesary information)
 <EntityType Name="Risks">
          <Key>
            <PropertyRef Name="RiskIdentity" />
          </Key>
          <Property Name="RiskIdentity" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="RiskLocationPoint" Type="geography" />        
 </EntityType>
When i try to call EntityConnectionFactory.CreateTransient("name=myEntities");

I am getting an error with key Not Found in dictionary. after importing the effort source code, the error seems to be occuring in the method
  public override TypeUsage GetEdmType(TypeUsage storeType)
        {
            string name = storeType.EdmType.Name.ToLowerInvariant();
            PrimitiveType edmType = this.StoreTypeNameToEdmPrimitiveType[name];

            return ConvertTypeUsage(storeType, edmType);
        }
because "geography" is not found in this.StoreTypeNameToEdmPrimitiveType. Any suggestions on how to resolve this? or will I not be able to use Effort for testing until they support Geography columns?
Aug 16, 2013 at 6:50 PM
I have found a workaround to this solution by hijacking the ssdl csdl and msl parsers and returning the same xml to them excluding the geography columns, to do this, modify the ParseResources method in the MetadataWorkspaceHelper class
Coordinator
Aug 17, 2013 at 8:26 PM
Hello,

Thank you for reporting this issue. The library indeed needs explicit support for this data type. I will add this feature to my TODO list.