private static void SeedDevData(MccContext context)
        {
            var testCampus = new Campus[]
            {
                new Campus()
                {
                    Id             = TestCampusId,
                    Hub            = null,
                    Lead           = TestCampusLeadId,
                    UniversityName = "Microsoft Global University",
                    Name           = "Campus Microsoft University",
                    CreatedAt      = DateTime.UtcNow,
                    ModifiedAt     = DateTime.UtcNow,
                    ModifiedBy     = Guid.NewGuid(),
                    AadGroupId     = Guid.Parse("bd8226ca-2e6c-4aa6-adcb-85ce8c871b1d")
                },
            };
            var testHubs = new Hub[]
            {
                new Hub()
                {
                    Id         = TestHubId,
                    AadGroupId = Guid.Parse("5460cdd4-a626-4cda-aa0b-f013e6eefea2"),
                    CreatedAt  = DateTime.UtcNow,
                    Name       = "Hub Global University",
                    Campus     = new List <Campus>()
                    {
                        testCampus[0]
                    },
                    Lead       = TestHubLeadId,
                    ModifiedAt = DateTime.UtcNow,
                    ModifiedBy = Guid.NewGuid()
                },
            };

            testCampus[0].Hub = testHubs[0];

            // check if all data is in database
            foreach (var h in testHubs)
            {
                if (context.Hubs.Any(h_ => h_.Id == h.Id))
                {
                    continue;
                }
                context.Hubs.Add(h);
            }

            foreach (var c in testCampus)
            {
                if (context.Campus.Any(c_ => c_.Id == c.Id))
                {
                    continue;
                }
                context.Campus.Add(c);
            }

            context.SaveChanges();
        }
        private static void SeedProdData(MccContext context, IGraphGroupService graphService)
        {
            var defaultRemoteHubId = Guid.Parse("00a7df8e-a810-4aa1-9791-6e0a79a911d3");

            // get all campus
            var allGroups = graphService.GetAllGroups().Result.ToList();

            // divide between hubs and campus
            var campusList = allGroups.Where(g => g.Name.StartsWith("Campus "));
            var hubs       = allGroups.Where(g => g.Name.StartsWith("Hub "));

            var dbHubs = hubs.Select(hub => new Hub()
            {
                AadGroupId = hub.Id,
                Campus     = new List <Campus>(),
                CreatedAt  = DateTime.UtcNow,
                Lead       = Guid.Empty,
                ModifiedAt = DateTime.UtcNow,
                Name       = hub.Name
            })
                         .ToList();

            foreach (var campus in campusList)
            {
                // check if campus exists, otherwise add it
                if (context.Campus.Any(c => c.AadGroupId == campus.Id))
                {
                    continue;
                }

                // find hub for campus
                if (!Guid.TryParse(campus.Description, out var hubId))
                {
                    // description could not be parsed as a guid -> take the default hub Id
                    hubId = defaultRemoteHubId;
                }

                var hub       = dbHubs.FirstOrDefault(h => h.AadGroupId == hubId);
                var newCampus = new Campus(campus.Name, Guid.Empty, campus.Id, campus.Name.Replace("Campus ", ""),
                                           Guid.Empty)
                {
                    Hub        = hub,
                    AadGroupId = campus.Id
                };
                // this will also add the campus to the corrsponding hub
                context.Campus.Add(newCampus);
            }

            var newHubs = dbHubs.Where(h => !context.Hubs.Any(hDb => hDb.AadGroupId == h.AadGroupId));

            context.Hubs.AddRange(newHubs);
            context.SaveChanges();
        }