static void Main()
        {
            var context = new PhonebookDB();

            Database.SetInitializer(new MigrateDatabaseToLatestVersion<PhonebookDB, Configuration>());

            Console.WriteLine(context.Contacts.Count());
        }
        private static void ImportContact(JToken contactObj)
        {
            var context = new PhonebookDB();
            var contact = new Contact();

            if (contactObj["name"] == null)
            {
                throw new Exception("Missing name");
            }
            else
            {
                contact.Name = contactObj["name"].Value<string>();
            }

            if (contactObj["company"] != null)
            {
                contact.Company = contactObj["company"].Value<string>();
            }

            if (contactObj["position"] != null)
            {
                contact.Position = contactObj["position"].Value<string>();
            }

            if (contactObj["site"] != null)
            {
                contact.Url = contactObj["site"].Value<string>();
            }

            if (contactObj["notes"] != null)
            {
                contact.Notes = contactObj["notes"].Value<string>();
            }

            var phones = contactObj["phones"];

            if (phones != null)
            {
                contact.Phones = new List<Phone>();
                foreach (var phone in phones)
                {
                    string value = phone.Value<string>();
                    contact.Phones.Add(new Phone { PhoneNumber = value });
                }
            }

            var emails = contactObj["emails"];

            if (emails != null)
            {
                contact.Emails = new List<Email>();

                foreach (var email in emails)
                {
                    string value = email.Value<string>();

                    contact.Emails.Add(new Email { EmailContact = value });
                }
            }
            context.Contacts.Add(contact);
            context.SaveChanges();
        }