Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Chroma: support auto-generation of keys only for GUIDs, as InMemory does
  • Loading branch information
Laurianti committed Oct 7, 2026
commit 7791e1c22a9c4864a00ca071fb4b51adfe9c44dc
7 changes: 7 additions & 0 deletions MEVD/src/Chroma/ChromaModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ protected override void ValidateKeyProperty(KeyPropertyModel keyProperty)
throw new NotSupportedException(
$"Property '{keyProperty.ModelName}' has unsupported type '{type.Name}'. Key properties must be either string or Guid.");
}

// String and Guid keys are supported by the Chroma provider, but we support auto-generation of keys only for GUIDs
if (keyProperty.IsAutoGenerated && keyProperty.Type != typeof(Guid))
{
throw new NotSupportedException(
$"Auto-generation is only supported for key properties of type Guid. Property '{keyProperty.ModelName}' has type '{keyProperty.Type.Name}'.");
}
}

// Checked when the collection object is constructed, rather than when it is first used.
Expand Down