Errors while generating entity code from efmodel built using existing codebase #150
Description
Hi @msawczyn , good afternoon ! Happy Saturday !
As mentioned in my #81 - I am trying to incorporate EF Core (v 3.1.1 now) in my Mobile App's Data services layer.
The diagram below shows the overall process I am following in getting a stable state of generating Entities using your EFDesigner tool and getting ready for generating SQLite database via EFCore migrations (which I have been trying to avoid on a parallel attempt to do that only via dbcontext scaffolding route).
Per diagram, after saving the efmodel I am facing number of errors in the generated code. Your help for in addressing my queries around that would be truly appreciated -
-
Does EFDesigner code generation has influence specifically to support SQL Server target as the database ? Which I am ok when read to take the effort for database behind my APIs but on mobile my target database is SQLite.
-
A new non-default constructor is created where initialization of the member variable including null check, and any other entity association is done. Apparently this constructor doesn't have any parameters. Is this by design ? The Create method attempts to call this constructor but compilation fails as there are not params in the non-default constructor. The error is "already defines a member called .ctor with the same parameter types.
-
Referred local variables in the new constructor are missing their definition -
e.g. if (string.IsNullOrEmpty(message)) throw new ArgumentNullException(nameof(message));
this.Message = message;
The "message" is suppose to be a member variable based on the entity property "Message". But, the generated class doesn't have a member variable by name message. I checked across the class files and those were missing, -
If I drop an updated class file from the first step (blue color blocks on the left in my diagram) on the left series of step onto efmodel, the generated code has duplicate entry for the collection causing errors.
-
How to stereotype entities as enum after the existing class is dropped on efmodel diagram?
-
In the lieu of SQLite - how to use associations to depict 1:1, 1:* and : relationships ?
-
Can warning such as missing documentation per entity attribute be shown on the left of the existing icons per attribute that way we can see both type of attribute and any missing input via warning sign ?
-
SQLBrowser utility supports exporting tables as CSV, Create Indexes, Views on SQLite db. Will you consider supporting such feature in the EFDesigner ?
I would appreciate if you would allow me to add additional errors in this github issue as I follow this path as mentioned in the process diagram below.
Will you please not close this issue until I get to fully create a stable entity model (as outlined in the diagram below) ?