Ends in:
4 DAYS
16 HRS
9 MIN
45 SEC
Ends in:
4 D
16 H
9 M
45 S
Open Closed

ABP Framework 8.2.3 .Include() method throw exception #8211


User avatar
0
DominaTang created

ABP Framework 8.2.3, Micro Service architect. SQL server Db, any query has .Include() would throw exception:

System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values. at Microsoft.Data.SqlClient.SqlBuffer.ThrowIfNull() at Microsoft.Data.SqlClient.SqlBuffer.get_String() at Microsoft.Data.SqlClient.SqlDataReader.GetString(Int32 i) at lambda_method1856(Closure, DbDataReader, Int32[]) at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadObject(DbDataReader reader, Int32 ordinal, ReaderColumn column) at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadRow()

Code: var query = await this.GetQueryableAsync(); var result = await query.Include(x => x.ChildEntity).Where (...).FirstOrDfaultAsync();

I check the EF core mapping and Db data, all valid.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the code and steps to reproduce the problem?

    Thanks,

    liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    it’s caused by ABP 8 ExtraProperties column is not null, but our existing data has Null value column.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 28, 2024, 07:27