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

8.0.0-alpha-3 System.InvalidCastException: Object cannot be cast from DBNull to other types. [DNET1019] #932

Closed
firebird-automations opened this issue Feb 25, 2021 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: Lynn Bennett (rlbennet)

<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="8.0.0-alpha3" />
<PackageReference Include="FirebirdSql.EntityFrameworkCore.Firebird" Version="8.0.0-alpha3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />

Scaffold-DbContext -Provider FirebirdSql.EntityFrameworkCore.Firebird -Connection "localhost..." -Tables CT_RELAYS_VIEW
-DataAnnotations -UseDatabaseNames

System.InvalidCastException: Object cannot be cast from DBNull to other types.
at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value, IFormatProvider provider)
at FirebirdSql.Data.Common.DbValue.GetInt32(AsyncWrappingCommonArgs async)
at FirebirdSql.Data.FirebirdClient.FbDataReader.GetInt32(Int32 i)
at FirebirdSql.EntityFrameworkCore.Firebird.Scaffolding.Internal.FbDatabaseModelFactory.GetTables(DbConnection connection, Func`3 filter)

Firebird 2.5.3 (Windows Build)
CREATE TABLE CT_RELAYS_VIEW
(
RELAY_TAG integer,
ELEMENT_DESIGNATION char(21),
ELEMENT_CODE char(4),
DS_ZONE_NUMBER char(2),
CT_TYPE char(2),
CT_NAME char(11)
);

@firebird-automations
Copy link
Author

Commented by: @cincuranet

I'm unable to reproduce on 3.0.7. Considering 2.5 (let alone 2.5.3) is useless, because it is going to fail sooner or later on i.e. RDB$IDENTITY_TYPE column.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants