-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...i-details/csharp/users/custom-user-data-create-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
The following example uses | ||
:ref:`MongoDB Data Access <sdks-access-mongodb>` to insert a | ||
document containing the user ID of the currently logged in user and several | ||
custom properties into the custom user data collection: | ||
|
||
.. literalinclude:: /examples/generated/dotnet/CustomUserDataExamples.snippet.create.cs | ||
:language: csharp | ||
|
||
You may find it helpful to create a C# class (POCO) that represents the custom | ||
user data object. The SDK will serialize/deserialize this class to and from BSON | ||
when writing, reading, and updating properties. The example above uses the | ||
following class to map the properties. |
4 changes: 4 additions & 0 deletions
4
...i-details/csharp/users/custom-user-data-delete-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The following example uses :ref:`MongoDB Data Access <sdks-access-mongodb>` to | ||
find and deletes the data through the | ||
:dotnet-sdk:`DeleteOneAsync() <reference/Realms.Sync.MongoClient.Collection-1.html#Realms_Sync_MongoClient_Collection_1_DeleteOneAsync_System_Object_>` | ||
method. |
6 changes: 6 additions & 0 deletions
6
...i-details/csharp/users/custom-user-data-read-custom-user-data-2-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. note:: | ||
|
||
If you require the most recent version of custom user data, call the | ||
:dotnet-sdk:`RefreshCustomDataAsync() | ||
<reference/Realms.Sync.User.html#Realms_Sync_User_RefreshCustomDataAsync>` | ||
method to request the latest version of a user's custom data. |
3 changes: 3 additions & 0 deletions
3
...api-details/csharp/users/custom-user-data-read-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
To read custom user data, call the | ||
:dotnet-sdk:`GetCustomData() <reference/Realms.Sync.User.html#Realms_Sync_User_GetCustomData>` | ||
method on the ``User`` object of a logged in user. |
4 changes: 4 additions & 0 deletions
4
...i-details/csharp/users/custom-user-data-update-custom-user-data-description.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The following example | ||
finds and updates the data by using the | ||
:dotnet-sdk:`UpdateOneAsync() <reference/Realms.Sync.MongoClient.Collection-1.html#Realms_Sync_MongoClient_Collection_1_UpdateOneAsync_System_Object_System_Object_System_Boolean_>` | ||
method, and then refreshes the data to ensure the latest changes are available. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters