-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reverse engineer support #3
Comments
Some issues with scaffolding
|
Can F# record types be exposed to another C# library? If not I think it would be useful to define the EF Models as class types. As for the ordering of files, I don't think we have a choice. While it might be bad database design, it is still possible for 2 tables in a database to reference each other, and our model would need to support that. This would required the |
Yes, an F# record type is exposed to C# like below
F# 4.1 introduced recursive modules so we can declare something like |
I'm going to reworking some of the RevEng interfaces for EF Core 2.1, I'll keep in mind that generators may want to put everything into a single file. |
cc @cartermp (FYI so you can track F# support for this in EF Core) |
You may use the C# version as a reference implementation. See CSharpModelGenerator and its subcomponents CSharpDbContextGenerator and CSharpEntityTypeGenerator. |
Just my two cents. It's been a while since I used EF - if possible, I'd recommend trying to stick with the standard set of types that F# devs use:
|
Depending on interoperability requirements we can create types as either records or class types, maybe depending on an input parameter. This is the approach I'm taking at the moment Good thinking regarding DU's for many-types-per-table style relationships, hadn't considered these models before but a discriminated union definitely makes the most sense |
Where is the reverse engineering implementation at? Can we put an alpha of it up on NuGet.org yet? |
Haven't worked on reverse engineer support in a while so will have to double check later when I get a chance but if it's not good for alpha it shouldn't take long to get it there |
@bricelam This is testing using Postgresql, a C# project performs the scaffold correctly The issue appears to be here Am I correct that currently EF Core will only load one instance of |
One from the user’s startup assembly. There can be multiple registered via DesignTimeServicesReferenceAttribute. The msbuild script adds this attribute to the startup project. |
Was able to scaffold the Northwind database without issue Caveats While #20 would not necessarily block an alpha release it is definitely something to be addressed soon as it is a major usability issue. We should not have to leave it up to the user to figure out the compilation order Have created #23 to merge these changes |
Initial support added |
…ref-exception Fix null ref exception
We'll need to implement
IScaffoldingCodeGenerator
to support scaffolding a model from the database.The text was updated successfully, but these errors were encountered: