You have to put the below code in your DBContext class, not in SnapShot class. Don’t modify the Snapshot class, it’s auto generated class.
modelBuilder.Entity<Country>()
.HasOne(a => a.CapitalCity)
.WithOne(a => a.Country)
.HasForeignKey<CapitalCity>(c => c.CountryID);