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
Query fails when using generic method with generic type constrait for interface like where T : IInterface with readonly members. Where this generic type is used as generic type of Database.Query<T> and Where() method is used.
Steps To Reproduce
Create generic method with query in it and interface must containts field Id
Call this method, with correct generic type, implemeting mentioned interfaca
GetResourceById<MyResource>(mytable,id);
Call fails on NullReferenceException.
Expected behavior
Correctly return selected item byt id, without throwing an exception.
Actual behavior
Cause of problem is readonly field Id on interface.
When KORM is creating TableInfo in ConventionModelMapper.CreateTableInfo() for where clausule. It is reading only writable properties from given type. Type in this case is interface from constraint, instead of correct generic type given for query.
KORM in this point should "know" it is creating only where clausule and properties doesn't have to be writable.
The text was updated successfully, but these errors were encountered:
Library name and version
Description
Query fails when using generic method with generic type constrait for interface like
where T : IInterface
with readonly members. Where this generic type is used as generic type ofDatabase.Query<T>
andWhere()
method is used.Steps To Reproduce
Expected behavior
Correctly return selected item byt id, without throwing an exception.
Actual behavior
Cause of problem is readonly field
Id
on interface.When KORM is creating
TableInfo
inConventionModelMapper.CreateTableInfo()
for where clausule. It is reading only writable properties from given type. Type in this case is interface from constraint, instead of correct generic type given for query.KORM in this point should "know" it is creating only where clausule and properties doesn't have to be writable.
The text was updated successfully, but these errors were encountered: