-
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
Generating Migrations loses using / namespace for custom types #5912
Comments
I believe that I could, However there are still other types in the Thanks! |
Note for triage: We used to have code to do this for spatial types in the old stack. I think we should do the same thing here. We can't put model types in the snapshot because they will change as the model changes, but these types should be okay--we just need to handle them in the code that generates the using statements. |
Interesting. I believe we have code to this this in the |
We cover namespaces for annotation enum values, but it looks like we're missing namespaces for the following:
|
@ajcvickers, @rowanmiller This issue still occurred in The generated script: Model: It seems that EF Core 1.1.0 cannot add the generic type's namespace yet. |
@kagamine I am having a hard time trying to imagine how this class gets mapped, but if you can provide a repro that works (besides the namespaces not being generated in migrations) it would be great if you could create a new issue for it and we will investigate. |
@divega It probably makes senses to look at the generic parameters regardless of whether the JsonObject stuff actually works right now. Re-opening to triage. |
Decided to create a new issue (#7352) for this instead so we don't lose release information for where this one was fixed. |
@ajcvickers makes sense. Thanks. |
Steps to reproduce
when creating a model add a custom type. In my case i am using
NpgsqlTypes.NpgsqlDateTime
(I have models with both methods atm for testing.)
The issue
I expect the command
dotnet ef migrations add [migration name]
to maintain the type definitions. either by adding ausing NpgsqlTypes;
or by keeping the type asNpgsqlTypes.NpgsqlDateTime
instead the following is generated:
Exception message:
Stack trace:
Further technical details
EF Core version: 1.0.0
Operating system:
Visual Studio version: VS code 1.2.1
Other details about my project setup:
The text was updated successfully, but these errors were encountered: