Closed WeberEric closed 4 years ago
It is not possible to generate views from a .dacpac, no data type information is available.
Hi Erik,
ok, i see. I haven't checked the method yet with which you parse/read the dacpac. I create my dacpac with a VisualStudio database template project. And this project creates a dacpac with a model.xml file. I don't know if this is mandatory for every dacpac.
Unter the key: DataSchemaModel-->Model-->Element (SqlView)-->Relationship-->Entry-->Element (SqlComputedColumn)-->Relationship-->Entry-->References you can find the key (name property) to get the original column (with schema and table name) with the original type.
I dont't know if this method works with all possible cases but for the 90% default cases this will work i think.
I hope this helps. Please let me know if you need further information.
Eric
I use DacFX - I will give it another try.
@WeberEric
I have attempted to fix this in the latest daily build, thanks for convincing me this could be done! Please try it out and let me know if it works for you.
@ErikEJ Thanks but the views are not displayed. Right click on the Project --> EF Core Power Tools --> Reverse Engineer --> select .dacpac project [Use EF Core 3.x] --> OK --> the views are not displayed. I also tryed to debug it but there are no changes on the relevant methodes. I tryed the latest code from master and the latest build from 'VSIX Gallery'. Any Ideas.
Eric
Ah! I need to show them also - coming up!
Now it works thank you. :-)
Now i found a new smaller problem. The generator does not use the alias of a column. It uses the referanced table column name.
Please log a new issue, and it would be useful if you could attach a .dacpac that reproduces the issue.
I managed to find the bug - hold your horses!
Now i found a new smaller problem. The generator does not use the alias of a column. It uses the referanced table column name.
I am unable to get that information from the .dacpac it seems, let me know if you conclude otherwise.
Thank you for your tray. I don't know if it is possible with your library but with the raw data (model.xml) it is possible. I think you get it but only for clarification I attached an image with 1/2; 1 is the alias (Name to use in the generated class) 2 is the original name/key to get the type. Thanks Eric
I have created issue https://github.com/ErikEJ/EFCorePowerTools/issues/393
Hi,
the support of dacpac to generate the classes is great. But the views are missing. Bug/Feature i don't know. :-)
Eric