-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Feature Suggestion : Being able to provide type mapping (or templates) for some column #1082
Comments
You should report the bad mapping to Oracle @alexkeh |
In EF Core, provider data type mapping for Migrations and Scaffolding must be the same. Providers cannot provide two different sets of mappings for each operation. That presents a problem when .NET data types are not the same size as Oracle DB data types. Either the migrations or scaffolding mapping will try to save data into a type that is too small. Since migrations is the more common use case, .NET data types map to larger Oracle DB data types. Of course, that means when scaffolding, the larger DB data types must now map to smaller .NET data types. The only solution is to manually adjust the type mapping until EF Core itself allows providers to provide two different mappings for scaffolding and migrations. |
@ajcvickers Is there an issue for this? |
I think you can assign a value converter to multiple properties in EF Core 6. |
Thanks @alexkeh , makes sense indeed. I have seen that there is a way to provide a mapping between types. However, I can find the doc only for the .NET framework but I don't find the doc to do it in .NET core. If it's possible, that would cleary answer part of my need ! |
@pedautreppe This capability is not available with the current Oracle EF Core provider. There is no longer an app.config, but perhaps it would be possible to load a custom configuration file with mappings. The key question is whether designing and setting up this extra infrastructure is worth it vs. the manual mapping developers do today. It may not be much of a productivity win compared to the provider work needed. |
This is not something I plan to support, apart from what you can already do in the partial OnModelCreatingPartial method, and by taking advantage of LINQ query to do batch modelling. |
I am currently working with EFCorePowerTools to reverse engineer a legacy Oracle Database.
I encounter 2 problems with my DB :
https://docs.oracle.com/en/database/oracle/oracle-data-access-components/19.3/odpnt/EFCoreREDataTypeMapping.html#GUID-4FF3A9A3-AE49-431B-A4FB-31F8C53FCCF5
To workaround those problem, I will ignore the corresponding column to handle myself :
This works perfeclty well, but can be quite cumbersome.
What would be great in the tool :
The text was updated successfully, but these errors were encountered: