Entity Framework not getting Spatial type data in result from Sql Server stored procedure

烂漫一生 提交于 2019-12-03 22:16:04

Alright...
As i was expecting (seeing previous posts like this) there was no answer to this problem, so now when i have solved the problem, i will linke to share the solution which got me the geography object.

I tried many things and tried many solution, i dropped my procedure and SP entry from edmx many times. And re created but all in vain!
Than what worked was so simple... following the link below i just opened edmx, than open model browser, in model browser go to your complex type defination which is missing the column, right click add->scalar property->geography. And give it the name precisely which is retured by stored procedure.
Thats it, save the changes and run your code, you must get your data properly as i am getting.
I am wondering why EF was not able to get the the data and on getting column information of the function/SP it mentioned EDM type unsupported. Strage!

Ref: http://www.scriptscoop.net/t/7c1ed5a0f89e/entity-framework-5-function-import-with-spatial-data.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!