You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since updating to 1.50.2 i'm getting an error with mapping to structs using SqlMapper
FatalExecutionEngineError occurred
HResult=-2146233082
Message=Exception of type 'System.ExecutionEngineException' was thrown.
InnerException:
I was able to reproduce this is a very simple scenario in a console application:
varconnection=newSqlConnection("Server=localhost;Database=TestDb;User Id=user;Password=password;");varsql="SELECT * FROM Dogs WHERE Id = @Id";varresult=SqlMapper.Query<Dog,SubData,Dog>(connection,sql,(dog,subdata)=>{dog.subData=subdata;returndog;},new{Id=1},splitOn:"Age");
For anyone looking for a workaround: I just let SqlMapper map to a intermediate class in stead of the struct. Then manually map to the struct in the Func.
Since updating to 1.50.2 i'm getting an error with mapping to structs using SqlMapper
I was able to reproduce this is a very simple scenario in a console application:
Model definitions:
The SQL-table is just 4 columns (nothing fancy)
I tried debugging
SqlMapper.cs
and found the exception is thrown in theSqlMapper.GenerateMapper
method. Actually when trying to execute the Func:When I remove the
Breed
property from the struct, it does work. So it seems to break when the struct contains more than one property.I'm not sure how to look any further into this.
Does anyone have any idea what this could be?
Same issue on 1.50.0
1.40.0 all working fine.
The text was updated successfully, but these errors were encountered: