c# - EntityType 'DbGeography' 没有在 EF6 上定义的键
问题描述
我已经检查了有关此的各种帖子,但我的问题没有解决。我使用的是 EF6,所以我的命名空间是System.Data.Spatial,我的参考是System.Data.Entity,但我仍然收到此错误:
Geocoder.DbGeography: : EntityType 'DbGeography' has no key defined.
Define the key for this EntityType.
DbGeographies: EntityType: EntitySet 'DbGeographies' is based on type 'DbGeography' that has no keys defined.
我的实体是这样的:
public class Address
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public DbGeography Geo { get; set; }
}
我在这里想念什么?
解决方案
推荐阅读
- java - AWS Kinesis - 如何从上一个检查点恢复消费
- asp.net-core - 在 ASP.NET Core 的类库中使用 Identity DbContext 和 DbContext
- javascript - 正则表达式 windows 路径验证器
- docker - 在 docker 容器中构建 SSIS 项目
- python - 返回该类的所有实例的另一个方法返回的值的总和?
- mysql - 如何以 24 小时计算显示时间结果
- windows - 从 windows-host 上的 windows-box 访问共享的 vagrant-folder 而不使用“net use”
- ios - 如何从 Rest API 发送推送通知
- entity-framework - 实体框架一对多:SqlException
- postgresql - postgres 查找匹配和不匹配的记录