title: Insert event to specific calendar in Google Calendar C#
body: <p>I have written an application that will add an event to Google Calendar.
  This works fine but is there a way that I can add this event to a specific calendar rather than the primary?</p>
  <p>This is my code:</p>
  <pre><code>        var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                          new ClientSecrets
                          {
                              ClientId = &quot;#&quot;,
                              ClientSecret = &quot;#&quot;,
                          },
                          new[] { CalendarService.Scope.Calendar },
                          &quot;user&quot;,
                          CancellationToken.None).Result;
  
          // Create the service.
          var service = new CalendarService(new BaseClientService.Initializer
          {
              HttpClientInitializer = credential,
              ApplicationName = &quot;Custom CRM&quot;,
          });
          var myEvent = new Event
          {
              Summary = &quot;Test contact&quot;,
              Location = &quot;1 Longford Drive&quot;,
              ColorId = &quot;6&quot;,
              
              Start = new EventDateTime()
              {
                  DateTime = new DateTime(2022, 2, 27, 14, 0, 0),
                  TimeZone = &quot;Asia/Karachi&quot;
              },
              End = new EventDateTime()
              {
                  DateTime = new DateTime(2022, 2, 28, 15, 0, 0),
                  TimeZone = &quot;Asia/Karachi&quot;
              },
              //Recurrence = new String[] { &quot;RRULE:FREQ=WEEKLY;BYDAY=MO&quot; },
              //If you want to add attendee
              //Attendees = new List&lt;EventAttendee&gt;()
              //{
              //    new EventAttendee { Email = &quot;youemail@yahoo.com&quot;}
              //},
          };
  
          var recurringEvent = service.Events.Insert(myEvent, &quot;primary&quot;);
          recurringEvent.SendNotifications = true;
          recurringEvent.Execute();
  
          MessageBox.Show(&quot;Event added!&quot;);
  </code></pre>
  <p>And I want to add the event to the calendar &quot;test&quot;:</p>
  <p><a href="https://i.stack.imgur.com/JwSTa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JwSTa.png" alt="enter image description here" /></a></p>