// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Program
{
DisplayName = "testprogram3",
Description = "test description",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Programs.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta programs create --body '{\
"displayName": "testprogram3",\
"description": "test description"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Program program = new Program();
program.setDisplayName("testprogram3");
program.setDescription("test description");
Program result = graphClient.programs().post(program);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Program;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Program();
$requestBody->setDisplayName('testprogram3');
$requestBody->setDescription('test description');
$result = $graphServiceClient->programs()->post($requestBody)->wait();