コード例 #1
0
        protected async Task <CreateContactCommand> CreateContactAsync(HttpClient client)
        {
            const string ApiPath = "api/v1/contacts";
            var          command = new CreateContactCommand(
                Guid.NewGuid(),
                Random.RandomString(10),
                Random.RandomString(10),
                RandomGen.Phone(),
                (int)ContactType.Directory.Id);

            var response = await client.PostAsync(ApiPath, command.ToJsonContent());

            response.EnsureSuccessStatusCode();

            return(command);
        }