SDK
SDK C# v2.x
2

UpdateSelfAsync #

Updates the current user object in Kuzzle.

Arguments #

Copied to clipboard!
public async Task<JObject> UpdateSelfAsync(JObject content);
Argument Type Description
content
JObject
JObject representing the user content

Return #

Return a JObject with the following properties:

Property Type Description
_id
string
User's kuid
_source
JObject
Additional (and optional) user properties

Exceptions #

Throws a KuzzleException if there is an error. See how to handle error.

Usage #

Copied to clipboard!
try {
  await kuzzle.Auth.LoginAsync(
    "local",
    JObject.Parse("{username: 'foo', password: 'bar'}"));
  JObject updatedUser = await kuzzle.Auth.UpdateSelfAsync(
    JObject.Parse("{age: 42}"));
  Console.WriteLine(updatedUser.ToString(Formatting.None));
  /*
  {
    "_id": "foo",
    "_source": {
      "profileIds": [
        "default"
      ],
      "_kuzzle_info": {
        "author": "-1",
        "createdAt": 1564566023173,
        "updatedAt": null,
        "updater": null
      },
      "age": 42
    }
  }
  */
} catch (KuzzleException e) {
  Console.WriteLine(e);
}