-
-
Notifications
You must be signed in to change notification settings - Fork 518
Open
Description
The following query
[StronglyTypedId(Template.Guid)]
public readonly partial struct ShopId;
var shopId = new ShopId(Guid.Parse("00000005-0000-0000-0000-000000000000"));
await _session.Query<Product>().Where(x => x.Shops.Any(s => s.ShopId== shopId)).ToPagedListAsync(pageNumber, pageSize, token);
// using strongly typed ID value
await _session.Query<Product>().Where(x => x.Shops.Any(s => s.ShopId.Value == shopId.Value)).ToPagedListAsync(pageNumber, pageSize, token);will ignore the where condition or rather build wrong SQL:
-- $2 = 50
select d.id, d.data, d.last_modified_by, d.mt_version, count(*) OVER() as total_rows from my_db.mt_doc_product as d where d.data -> 'Shops' @> $1 order by d.data ->> 'Name' LIMIT $2Expected
$1 should be '[{"ShopId": "00000005-0000-0000-0000-000000000000"}]'
Actual
$1 = '[{}]'
From debugging I assume it's because _data is not set
I think it's because the query can't handle strongly typed IDs?
I added my value types to marten via
options.RegisterValueType<ShopId>();Workaround
Use raw SQL
Metadata
Metadata
Assignees
Labels
No labels