Exemplo n.º 1
0
        private async Task UpdateCountry(Dynamics365ApiClient apiClient, Guid contactId)
        {
            var fields = new Dictionary <string, object>
            {
                ["country"] = "Italy"
            };

            await apiClient.UpdatePropertyAsync("contacts", contactId, fields);
        }
Exemplo n.º 2
0
 public async Task Run()
 {
     using (var apiClient = new Dynamics365ApiClient(serviceUrl, clientId, redirectUrl))
     {
         Guid contactId = await CreateContact(apiClient);
         await UpdateContact(apiClient, contactId);
         await UpdateCountry(apiClient, contactId);
     }
 }
Exemplo n.º 3
0
        private async Task UpdateContact(Dynamics365ApiClient apiClient, Guid contactId)
        {
            var fields = new Dictionary <string, object>
            {
                ["firstName"] = "Stefano",
                ["lastName"]  = "Tempesta",
                ["country"]   = "Italy"
            };

            await apiClient.UpdateEntityAsync("contacts", contactId, fields);
        }
Exemplo n.º 4
0
        private async Task <Guid> CreateContact(Dynamics365ApiClient apiClient)
        {
            var fields = new Dictionary <string, object>
            {
                ["firstName"] = "Stefano",
                ["lastName"]  = "Tempesta",
                ["country"]   = "Switzerland"
            };

            Guid entityId = await apiClient.CreateEntityAsync("contacts", fields);

            return(entityId);
        }