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)
-
0
hi
Can you share the code and steps to reproduce the problem?
Thanks,
liming.ma@volosoft.com
-
0
it’s caused by ABP 8 ExtraProperties column is not null, but our existing data has Null value column.