Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoolToStringConverter should not check if falseValue or trueValue is empty #15294

Closed
wdegraaf-travel1 opened this issue Apr 9, 2019 · 0 comments · Fixed by #15435
Closed
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@wdegraaf-travel1
Copy link

I have a legacy database in SQL Server with columns that represent boolean data in a nvarchar(1) column with a blank string representing false and "X" representing true.
I should be able to represent these columns in C# with a boolean parameter and an appropriate converter, but I cannot. The BoolToStringConverter does not accept blank strings to represent false.

entity.Property(p => p.SomeBooleanProperty).HasConversion(new BoolToStringConverter(falseValue: " ", trueValue: "X"));

Exception message:
System.ArgumentException: 'The string argument 'falseValue' cannot be empty.'

Further technical details

EF Core version: 2.2.3
Database Provider: Microsoft.EntityFrameworkCore.SqlServer 2.2.3
Operating system: Windows 10
IDE: Visual Studio Professional 15.9.11

@ajcvickers ajcvickers added this to the 3.0.0 milestone Apr 12, 2019
@ajcvickers ajcvickers self-assigned this Apr 12, 2019
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 21, 2019
ajcvickers added a commit that referenced this issue Apr 21, 2019
* Fixes #15294 - BoolToStringConverter should not check if falseValue or trueValue is empty
* Fixes #15266 - Small typo in resource file
* Fixes #14037 - XML comments for DbContext.Attach unclear
* Fixes #14001 - DbSet.Local does not automatically call DetectChanges
* Fixes #13210 - WithExtension suggests that 'this' is updated, as well as returning 'this'
ajcvickers added a commit that referenced this issue Apr 21, 2019
* Fixes #15294 - BoolToStringConverter should not check if falseValue or trueValue is empty
* Fixes #15266 - Small typo in resource file
* Fixes #14037 - XML comments for DbContext.Attach unclear
* Fixes #14001 - DbSet.Local does not automatically call DetectChanges
* Fixes #13210 - WithExtension suggests that 'this' is updated, as well as returning 'this'
ajcvickers added a commit that referenced this issue Apr 22, 2019
* Fixes #15294 - BoolToStringConverter should not check if falseValue or trueValue is empty
* Fixes #15266 - Small typo in resource file
* Fixes #14037 - XML comments for DbContext.Attach unclear
* Fixes #14001 - DbSet.Local does not automatically call DetectChanges
* Fixes #13210 - WithExtension suggests that 'this' is updated, as well as returning 'this'
ajcvickers added a commit that referenced this issue Apr 22, 2019
* Fixes #15294 - BoolToStringConverter should not check if falseValue or trueValue is empty
* Fixes #15266 - Small typo in resource file
* Fixes #14037 - XML comments for DbContext.Attach unclear
* Fixes #14001 - DbSet.Local does not automatically call DetectChanges
* Fixes #13210 - WithExtension suggests that 'this' is updated, as well as returning 'this'
ajcvickers added a commit that referenced this issue Apr 22, 2019
* Fixes #15294 - BoolToStringConverter should not check if falseValue or trueValue is empty
* Fixes #15266 - Small typo in resource file
* Fixes #14037 - XML comments for DbContext.Attach unclear
* Fixes #14001 - DbSet.Local does not automatically call DetectChanges
* Fixes #13210 - WithExtension suggests that 'this' is updated, as well as returning 'this'
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview6 Jun 5, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview6, 3.0.0 Nov 11, 2019
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants