public async Task Run(string apiKey) { if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentException("Cannot be null, empty or whitespace", nameof(apiKey)); } MerakiDashboardClient merakiDashboardClient = MerakiDashboardClientFactory.Create(mcs => mcs.ApiKey = apiKey); const string organizationName = "Meraki Live Sandbox"; string organizationId = MerakiDashboardHelper.GetOrganizationId(merakiDashboardClient, organizationName).Result; foreach (Func <MerakiDashboardClient, string, Task> exercise in new Func <MerakiDashboardClient, string, Task>[] { }) { await exercise(merakiDashboardClient, organizationId); } }
public async Task Run(string apiKey) { if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentException("Cannot be null, empty or whitespace", nameof(apiKey)); } using (MerakiDashboardClient merakiDashboardClient = MerakiDashboardClientFactory.Create(apiKey)) { const string organizationName = "Meraki Live Demo"; string organizationId = MerakiDashboardHelper.GetOrganizationId(merakiDashboardClient, organizationName).Result; foreach (Func <MerakiDashboardClient, string, Task> exercise in new Func <MerakiDashboardClient, string, Task>[] { Exercise1, Exercise2, Exercise3, Exercise4, Exercise5, Exercise6, Exercise7, Exercise8 }) { await exercise(merakiDashboardClient, organizationId); } } }