Reputation: 417
After searching for hours I found some Solutions on how to "Map" Database TinyInt to .Net Boolean. One Answer was to change the ColumnType to Bit an the other one was to use Mapping Attributes but both would be quiet a big mess with an immense effort. My Databse got about 200+ Tables with corrosponding Models and tonns of bool Attributes.
I'm searching for a method to overwrite the default mapping of EFCore to map boolean to tinyint.
Why am I doing or needing this?
We used Telerik OpenAccess until now and implemented many Services with that. Now that this won't be supportet in the future we want to switch to EFCore. Because there are many Services for different Applications but all using the same Database I need to replace OpenAccess bit by bit so just changing all DB-Columns from TinyInt (which was used by OpenAccess for boolean) to bit (EFCore Default) won't work. The Second solution to add "Mapping-Attributes" for each boolean would be an immense effort because of the big amount of Objects.
Just switching the Type-Mapping from EFCore or anything simillar to that would be the best or easiest solution i guess.
Would be great to hear if someone knows another Solution for my Problem then the two mentioned above.
Upvotes: 1
Views: 380
Reputation: 417
If someone is trying the same to use Telerik OpenAccess/DataAcces at the same time with EF or EF Core you can just change all tinyint
columns in your Database to bit.
OpenAcces will work without any problems even if the colums are bit instead of default tinyint and Ef Core will work as usual.
Even if this is not the satisfying answer to my question, it is a possible workaround or a solution to make both work.
Upvotes: 1