henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

Combining predicate and One-to-many relations #270

Closed jorismathijssen closed 1 year ago

jorismathijssen commented 2 years ago

Is there a way to combine predicates and one-to-many relations?

I got a table with a foreign key reference. I can get the table with GetAsync and map the relations.

But i don't want to get the initial row by primary key but by a reference field. I can use SelectAsync and a predicate to get this row by the reference field.

henkmollema commented 2 years ago

@jorismathijssen this should be supported in the latest version, e.g.:

var products = con.Select<Product, Category, ProductOption, Product>(x => x.Name.StartsWith("Bike"));