// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new ProjectParticipation
{
AllowedAudiences = AllowedAudiences.Organization,
Client = new CompanyDetail
{
Department = "Corporate Marketing",
WebUrl = "https://www.contoso.com",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Profile.Projects["{projectParticipation-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ProjectParticipation projectParticipation = new ProjectParticipation();
projectParticipation.setAllowedAudiences(EnumSet.of(AllowedAudiences.Organization));
CompanyDetail client = new CompanyDetail();
client.setDepartment("Corporate Marketing");
client.setWebUrl("https://www.contoso.com");
projectParticipation.setClient(client);
ProjectParticipation result = graphClient.me().profile().projects().byProjectParticipationId("{projectParticipation-id}").patch(projectParticipation);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ProjectParticipation;
use Microsoft\Graph\Generated\Models\CompanyDetail;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ProjectParticipation();
$requestBody->setAllowedAudiences(new AllowedAudiences('organization'));
$client = new CompanyDetail();
$client->setDepartment('Corporate Marketing');
$client->setWebUrl('https://www.contoso.com');
$requestBody->setClient($client);
$result = $graphServiceClient->me()->profile()->projects()->byProjectParticipationId('projectParticipation-id')->patch($requestBody)->wait();