Skip to content

Commit 5022663

Browse files
Change GUID values (#5233)
Co-authored-by: OpenPublishing.Build <opbuild@microsoft.com>
1 parent b78e017 commit 5022663

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

entity-framework/core/providers/cosmos/querying.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
4848
}
4949

5050
var tenantId = "Microsoft";
51-
var userId = new Guid("99A410D7-E467-4CC5-92DE-148F3FC53F4C");
51+
var userId = new Guid("00aa00aa-bb11-cc22-dd33-44ee44ee44ee");
5252
var username = "scott";
5353

5454
var sessions = await context.Sessions
@@ -63,7 +63,7 @@ var sessions = await context.Sessions
6363
Examining the logs generated by EF, we see this query executed as follows:
6464

6565
```sql
66-
Executed ReadNext (166.6985 ms, 2.8 RU) ActivityId='312da0d2-095c-4e73-afab-27072b5ad33c', Container='test', Partition='["Microsoft","99a410d7-e467-4cc5-92de-148f3fc53f4c"]', Parameters=[]
66+
Executed ReadNext (166.6985 ms, 2.8 RU) ActivityId='312da0d2-095c-4e73-afab-27072b5ad33c', Container='test', Partition='["Microsoft","00aa00aa-bb11-cc22-dd33-44ee44ee44ee"]', Parameters=[]
6767
SELECT VALUE c
6868
FROM root c
6969
WHERE ((c["SessionId"] > 0) AND CONTAINS(c["Username"], "a"))
@@ -105,7 +105,7 @@ var session = await context.Sessions.SingleAsync(
105105
In this query, a value for the `Id` property is provided (which is mapped to the Azure Cosmos DB `id` property), as well as values for all the partition key properties. Furthermore, there are no additional components to the query. When all these conditions are met, EF is able to execute the query as a point read:
106106

107107
```console
108-
Executed ReadItem (46 ms, 1 RU) ActivityId='d7391311-2266-4811-ae2d-535904c42c43', Container='test', Id='9', Partition='["Microsoft","99a410d7-e467-4cc5-92de-148f3fc53f4c",10.0]'
108+
Executed ReadItem (46 ms, 1 RU) ActivityId='d7391311-2266-4811-ae2d-535904c42c43', Container='test', Id='9', Partition='["Microsoft","00aa00aa-bb11-cc22-dd33-44ee44ee44ee",10.0]'
109109
```
110110

111111
Note the `ReadItem`, which indicates that the query was executed as an efficient point read - no SQL query is involved.

entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ When executing this query, EF Core will extract the values of the `tenantId`, `u
133133

134134
```output
135135
info: 6/10/2024 19:06:00.017 CosmosEventId.ExecutingSqlQuery[30100] (Microsoft.EntityFrameworkCore.Database.Command)
136-
Executing SQL query for container 'UserSessionContext' in partition '["Microsoft","99a410d7-e467-4cc5-92de-148f3fc53f4c",7.0]' [Parameters=[]]
136+
Executing SQL query for container 'UserSessionContext' in partition '["Microsoft","00aa00aa-bb11-cc22-dd33-44ee44ee44ee",7.0]' [Parameters=[]]
137137
SELECT c
138138
FROM root c
139139
WHERE ((c["Discriminator"] = "UserSession") AND CONTAINS(c["Username"], "a"))
140140
```
141141

142-
Notice that the partition key comparisons have been removed from the `WHERE` clause, and are instead used as the partition key for efficient execution: `["Microsoft","99a410d7-e467-4cc5-92de-148f3fc53f4c",7.0]`.
142+
Notice that the partition key comparisons have been removed from the `WHERE` clause, and are instead used as the partition key for efficient execution: `["Microsoft","00aa00aa-bb11-cc22-dd33-44ee44ee44ee",7.0]`.
143143

144144
For more information, see the documentation on [querying with partition keys](xref:core/providers/cosmos/querying#partition-keys).
145145

0 commit comments

Comments
 (0)