[英]Using SqlGeography in code-first EF6 not generating column
我正在使用VS2013,.Net 4.5,EF6,MVC5,MSSQL服务器为11.00.2100
当我在模型中创建一个属性时:
public SqlGeography Position { get; set; }
然后使用update-database不会对该模型的数据库表进行任何更改。
我正在从此参考中使用SqlGeography:
Microsoft.SqlServer.Types.SqlGeography
我该如何解决?
您需要使用EF中的DbGeography
类型,然后由Sql Server提供程序将其转换为SqlGeography
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.