Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes to code example.

...

Code Block
languagec#
themeRDark
titleC# - Create a person
linenumberstrue
collapsetrue
            var credentials = new Credentials
            {
                UserName = "UserName",
                Password = "Password"
            };

            var createPersonRequest = new CreatePersonRequest
            {
                Credentials = CorrectCredentials()credentials,
                identify = CorrectIdentify()"uniqueIdentifierForYourBfsInstance",
                Entities = new[]
                {
                    new Person
                    {
                        FirstName = "FirstName",
                        LastName = "LastName",
                        UserName = "UserName",
                        Password = "Password",
                        Email = "email@email.com",
                        IsNaturalPerson = true,
                    }
                }
            };

            var response = client.CreatePersons(createPersonRequest);

            foreach (var createdPerson in response.Entities)
            {
                Console.WriteLine($"BrickId: {createdPerson.BrickId}");
            }

...