Reposting this StackOverflow question in seek of something that I miss so that I don't have to write my own LINQ providers as answered in the comment from usr.
I have the following call in my ViewModel.
Order order= await DataService.Orders.GetAsync(p => p.Id == Guid.Parse("07fafcd9-10db-e511-848d-005056b94716"));
Reposting this StackOverflow question in seek of something that I miss so that I don't have to write my own LINQ providers as answered in the comment from usr.
I have the following call in my ViewModel.
Order order= await DataService.Orders.GetAsync(p => p.Id == Guid.Parse("07fafcd9-10db-e511-848d-005056b94716"));
The Orders repository has the following method.
Db property is of type
SQLiteAsyncConnection
. The predicate I provided above will translate to the below representation.{p => (p.Id == Parse("07fafcd9-10db-e511-848d-005056b94716"))}
The above predicate will throw an exception with the following message
So I'm passing the
Guid.Parse
function down which doesn't exist, similar exception it will be thrown if I have the following predicate.Order order= await DataService.Orders.GetAsync(p => p.Id == anotherInstanceObject.Id);
The solution is to replace my code with passing the actual value.
But the above is so counter intuitive and will introduce a lot of problems when developers will start using the DataService class.
What am I missing to make the predicate correctly compile down to my repository method?