S
S
stcmd042362016-06-30 12:40:25
Exceptions
stcmd04236, 2016-06-30 12:40:25

EF 6 throws exception when using DBGeography type?

I'm trying to use the DBGeography type from the System.Data.Entity.Spatial namespace in EF6 but ef throws the following exception:
There is no store type corresponding to the conceptual side type 'Geography' of primitive type 'Geography'.
Here is the class itself:

public class Coordinate : IObject
  {
    public int Id { get; set; }

    public DbGeography Location { get; set; }

    public string Address { get; set; }

    public bool Status { get; set; }
  }

Base SQL Server Express 9.0.1399
It seems that in express versions there are no restrictions on the type. What is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Evseev, 2016-07-07
@stcmd04236

Judging by the version number you have Sql Server Express 2005 - it's still an old DBMS.
And spatial types appeared only in Sql Server 2008: https://msdn.microsoft.com/en-us/library/cc280766.aspx
https://msdn.microsoft.com/en-us/library/bb964711(...
So EF justifiably swears.You should install a newer DBMS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question