Hi.
I am creating a OrmLite.IdentityStore project to use AspNet Identity with OrmLite.
Since POCO Id property is a generic type I need to use Equals() to query for this column, but using this I get a NotSupportedException() error in method SqlExpression.VisitColumnAccessMethod(MethodCallExpression m).
This is my code:
return db.Single<TUserToken>(x => x.UserId.Equals(user.Id) && x.LoginProvider == loginProvider && x.Name == name);
I had to change SqlExpression.VisitColumnAccessMethod like this:
SqlExpression.VisitColumnAccessMethod(MethodCallExpression m)
{
....
switch (m.Method.Name)
{
case "Equals":
statement = $$"{quotedColName}={ConvertToParam(wildcardArg)}";
break;
....
With this change it works and the generated SQL text is what is expected.
Is this the right solution or am I missing something here?
Thanks.
Luis