CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`id` int NOT NULL AUTO_INCREMENT,
`Gender` bit(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
dotnet ef dbcontext scaffold "Server=localhost;Database=mydb;User=root;Password=1111;TreatTinyAsBoolean=true;" Pomelo.EntityFrameworkCore.MySql -c MyDB -f -d --no-build -p
With TreatTinyAsBoolean=false; same result.
Using scaffold command I expect to get mapped c# boolean property from bit(1) mysql column 'Gender'. As was with .net core 2.2.
But i got
c#
...
[Column(TypeName = "bit(1)")]
public ulong Gender { get; set; }
...
.net core 3.1.8
Please update to the latest version 3.2.2 and see https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/917#issuecomment-565340084 and https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/577#issuecomment-568211228 along w/ PR https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/pull/909.
Ok. I got this problem in 3.2.2.
Please update to the latest version 3.2.2 and see #917 (comment) and #577 (comment) along w/ PR #909.
Ok. I got this problem in 3.2.2.
@alex-dubatov Just give us a short feedback, that https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/917#issuecomment-565340084 mentioned by @mguinness solves your issue (which it should), so we can close this one as a duplicate.
TreatTinyAsBoolean=false;. I still don't get bit(1) as bool.917 doesn't solve my issue because with TreatTinyAsBoolean=false;. I still don't get bit(1) as bool.
@alex-dubatov Thanks for reporting this issue! It is a regression bug introduced with #1066. We will release a fix (see #1188) shortly.
@lauxjpn Thanks for you!
I will close the issue after checking the release.
@alex-dubatov The fix is now part of the nightly build feed, in case you want to start using it.
@lauxjpn nuget doesn't find version 3.2.3 in nightly build feed.
Also command below doesn't show version 3.2.3.
nuget list -AllVersions -Source "https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json"
nuget doesn't find version 3.2.3 in nightly build feed.
@alex-dubatov The release is 3.2.3-servicing.20511.3 and was added to the feed yesterday.
You need to enable prereleases (use either the checkbox in VS or the -Prerelease option for nuget.exe).
@lauxjpn Thank you very much for the info!!