Commit 5f282a9
Refactor CollectionModel/builder and introduce read-only property interfaces (#13699)
## Changes
* **Extract `ConfigureVectorPropertyEmbedding()`**: Deduplicated
embedding resolution logic that was repeated across
`ProcessTypeProperties` and `ProcessRecordDefinition`.
* **Replace `IRecordCreator` with `Func<object>`**: Removed
`IRecordCreator` interface and two implementing classes
(`ActivatorBasedRecordCreator`, `DynamicRecordCreator`), replacing them
with simple lambdas.
* **Rename `TemporaryStorageName` → `SerializedKeyName`**: Moved from
`PropertyModel` base to `KeyPropertyModel` where it belongs (only used
by CosmosNoSql for key property JSON serializer name remapping).
* **Delegate-based property accessors**: Replaced virtual
`GetValueAsObject`/`SetValueAsObject` overrides with delegate fields
(`_getter`/`_setter`), configured via
`ConfigurePocoAccessors()`/`ConfigureDynamicAccessors()`. Converted
null-coalescing throws to `Debug.Assert`.
* **Improved xmldoc** on `VectorPropertyModel.EmbeddingType` explaining
the `[AllowNull]` invariant.
* **Introduce read-only interfaces** (`IPropertyModel`,
`IKeyPropertyModel`, `IDataPropertyModel`, `IVectorPropertyModel`):
`CollectionModel` now exposes `IReadOnlyList<IVectorPropertyModel>`
etc., giving providers an immutable view post-build. All provider code
updated to consume interface types.
Note that the last is a non-trivial breaking change for providers (not
users), which I think is fine (note that the provider-facing APIs are
flagged as [Experimental]).
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 9d120bc commit 5f282a9
File tree
10 files changed
+284
-325
lines changed- dotnet
- src
- InternalUtilities/connectors/Memory/MongoDB
- VectorData
- CosmosNoSql
- SqliteVec
- VectorData.Abstractions/ProviderServices
10 files changed
+284
-325
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | | - | |
| 32 | + | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
98 | | - | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments