-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geography field mapping add 'TempId1' to column name #3034
Comments
Not possible yet, it is in progess for after RTM #1100 |
As @ErikEJ mentioned, geography types are not yet supported |
@smitpatel can you check what we do in the latest code base. We should throw in this case but the error about |
@smitpatel can you also follow up with us about the exception we do throw in this case so that we can verify it is something we are happy with |
Adding Geography type throws following exception while adding migration since we are pulling the type as entity type.
I am still not able to figure out how the error about |
I don't use EF migrations to generate my entities; this error is thrown when I execute my API trying to get some entity via REST: http://localhost:61241/api/company In any case, if you still needing the code, I can share the code in a repository. |
@unairoldan - with the information - "migrations are not used", I am able to get a repro on this. It looks like that model validation rules not being run properly. |
Root cause: As for the original issue here, since spatial data types are not supported they would be expanded assuming entity types. Therefore model you get is a lot different from the database tables and query fails. @rowanmiller - While adding non-supported type as navigation, we may encounter entity type without PK which would throw in validation or we may get PK set by convention which would be valid model and no error will be thrown. Is this behavior fine? |
@smitpatel yes, that is what we would expect to see |
Once #3109 is resolved, user will get exception about null PK. That should block usage of model far earlier than reaching the exception about wrong column name. Closing this out as there is nothing actionable here. Better exception while spatial/complex type expanded as entitytype -> #3109 |
I am creating an API usign Asp.Net 5 (beta 6), with Entity Framework 7.0.0-beta6.
This is the project.json file:
And here is my model and EF entity:
All the fields in my entity Address (and in every entity in my project) is working and is correctly mapped, but in case of Geography field, in this case called "Location", I get this error:
EF is trying to get the column LocationTempId1, I do not the reason.
I have tried to solve adding the explicit column mapping in my model definition, but it does not work:
Does anyone know how to solve this issue?
The text was updated successfully, but these errors were encountered: