I'm stuck updating my .NET Framework 4.8 app, using Entity Framework 6 with a PostgreSQL database which is in the Amazon Aurora Cluster ecosystem. I'm using the Database First Approach and have Npgsql in place as data provider. I also added the Npgsql PostgreSQL Integration extension to use the Data Model Wizard.
Once clicking through the Entity Data Model Wizard, the generated .edmx shows warnings:
Errors Found During Generation: warning 6005: The data type 'bit' is currently not supported for the target Entity Framework version; the column 'column1' in the table 'table1' was excluded.
Everything works fine, but all bit type columns are skipped and not included in the model since bit is no primitive postgresql datatype.
I'm not able to modify the database structure, since my app just connects to that existing ecosystem.
I already tried to modify the .edmx file manually, adjstusting the SSDL / CSDL / Mapping content and the model itself by adding a bool type for all bit datatypes. But that's not working - results into:
Error 40: The Type bool is not qualified with a namespace or alias. Only primitive types can be used without qualification
Npgsql + Entity Framework + Edmx with column type bit is no solution, since I'm not able to modify the database.
Is there any way to specify a custom mapping for this?
Really appreciate any help solving that.
Versions:
| Version | |
|---|---|
| .NET Framework | 4.8 |
| EntityFramework | 6.4.4 |
| EntityFramework6.Npgsql | 6.4.3 |
| PostgreSQL (within Amazon Aurora Cluster) | 13.7 |
Edit: Added the notes that I'm dealing with an Amazon Aurora Cluster with PostgreSQL
After hours of research, I've found out that there is no way to achieve this. I ended up pushing a request for altering the whole database structure.