Skip to content

Commit fcfdeeb

Browse files
committed
refactor(morphdb): use the client's constructors now that they are callable
MorphDB.Client 0.5.1 adds [SetsRequiredMembers] to Filter and OrderBy, so their constructors compile. The object initializers here were working around that, not expressing a preference. Verified against the published package, not a local build.
1 parent 1c4f032 commit fcfdeeb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- Composition / adapters -->
88
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.10" />
99
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
10-
<PackageVersion Include="MorphDB.Client" Version="0.5.0" />
10+
<PackageVersion Include="MorphDB.Client" Version="0.5.1" />
1111
<PackageVersion Include="Npgsql" Version="10.0.3" />
1212
</ItemGroup>
1313

src/Formbase.MorphDb/MorphDbProjectionStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public async Task<int> BulkInsertAsync(string tableName, IReadOnlyList<IReadOnly
8585
var request = new QueryRequest
8686
{
8787
Filters = spec.Filters is { Count: > 0 } filters
88-
? filters.Select(f => new Filter { Column = f.Key, Operator = FilterOperator.Equal, Value = f.Value }).ToList()
88+
? filters.Select(f => new Filter(f.Key, FilterOperator.Equal, f.Value)).ToList()
8989
: [],
9090
// Server-side ordering — the only way paging is deterministic (a client-side sort would order
9191
// an already-arbitrary page). Descending maps to ascending: false.
9292
OrderBy = spec.OrderBy is { Count: > 0 } orderBy
93-
? orderBy.Select(k => new OrderBy { Column = k.Column, Ascending = !k.Descending }).ToList()
93+
? orderBy.Select(k => new OrderBy(k.Column, ascending: !k.Descending)).ToList()
9494
: [],
9595
PageSize = pageSize,
9696
// MorphDB pages are 1-based; exact offset requires it to align to the page size.

0 commit comments

Comments
 (0)