We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd84c4c commit f4cffd1Copy full SHA for f4cffd1
1 file changed
docs/contributing/code-style/csharp.md
@@ -180,10 +180,17 @@ timestamp information for sequential ordering.
180
// Good
181
var id = CoreHelpers.GenerateComb();
182
183
-// Bad
+// Bad - for entity IDs, don't use Guid.NewGuid()
184
var id = Guid.NewGuid();
185
```
186
187
+:::note
188
+
189
+For non-primary-key GUIDs (e.g. correlation IDs or other values not used as a database primary key),
190
+`Guid.NewGuid()` is acceptable.
191
192
+:::
193
194
Entities should implement `SetNewId()`:
195
196
```csharp
0 commit comments