ApiSdk.Me.CalendarGroups.Item.Calendars.Item.CalendarView.Item.Instances.Item.MultiValueExtendedProperties.Item.MultiValueLegacyExtendedPropertyItemRequestBuilder.BuildPatchCommand C# (CSharp) Method

BuildPatchCommand() public method

Update the navigation property multiValueExtendedProperties in me
public BuildPatchCommand ( ) : Command
return Command
        public Command BuildPatchCommand() {
            var command = new Command("patch");
            command.Description = "Update the navigation property multiValueExtendedProperties in me";
            // Create options for all the parameters
            var calendarGroupIdOption = new Option<string>("--calendar-group-id", description: "key: id of calendarGroup") {
            };
            calendarGroupIdOption.IsRequired = true;
            command.AddOption(calendarGroupIdOption);
            var calendarIdOption = new Option<string>("--calendar-id", description: "key: id of calendar") {
            };
            calendarIdOption.IsRequired = true;
            command.AddOption(calendarIdOption);
            var eventIdOption = new Option<string>("--event-id", description: "key: id of event") {
            };
            eventIdOption.IsRequired = true;
            command.AddOption(eventIdOption);
            var eventId1Option = new Option<string>("--event-id1", description: "key: id of event") {
            };
            eventId1Option.IsRequired = true;
            command.AddOption(eventId1Option);
            var multiValueLegacyExtendedPropertyIdOption = new Option<string>("--multi-value-legacy-extended-property-id", description: "key: id of multiValueLegacyExtendedProperty") {
            };
            multiValueLegacyExtendedPropertyIdOption.IsRequired = true;
            command.AddOption(multiValueLegacyExtendedPropertyIdOption);
            var bodyOption = new Option<string>("--body") {
            };
            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async (object[] parameters) => {
                var calendarGroupId = (string) parameters[0];
                var calendarId = (string) parameters[1];
                var eventId = (string) parameters[2];
                var eventId1 = (string) parameters[3];
                var multiValueLegacyExtendedPropertyId = (string) parameters[4];
                var body = (string) parameters[5];
                var cancellationToken = (CancellationToken) parameters[6];
                using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model = parseNode.GetObjectValue<MultiValueLegacyExtendedProperty>(MultiValueLegacyExtendedProperty.CreateFromDiscriminatorValue);
                var requestInfo = CreatePatchRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("calendarGroup%2Did", calendarGroupId);
                requestInfo.PathParameters.Add("calendar%2Did", calendarId);
                requestInfo.PathParameters.Add("event%2Did", eventId);
                requestInfo.PathParameters.Add("event%2Did1", eventId1);
                requestInfo.PathParameters.Add("multiValueLegacyExtendedProperty%2Did", multiValueLegacyExtendedPropertyId);
                var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
                    {"4XX", ODataError.CreateFromDiscriminatorValue},
                    {"5XX", ODataError.CreateFromDiscriminatorValue},
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(calendarGroupIdOption, calendarIdOption, eventIdOption, eventId1Option, multiValueLegacyExtendedPropertyIdOption, bodyOption, new TypeBinding(typeof(CancellationToken))));
            return command;
        }
        /// <summary>