static void Main()
        {
            string contactsJson = File.ReadAllText("../../contacts.json");
            var contacts = JArray.Parse(contactsJson);
            var context = new PhonebookContext();

            foreach (var contact in contacts)
            {
                if (contact["name"] != null)
                {
                    var currentContact = new Contact();
                    currentContact.Name = contact["name"].Value<string>();

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

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

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

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

                    if (contact["phones"] != null)
                    {
                        foreach (var phone in contact["phones"])
                        {
                            var currentPhone = new Phone() { PhoneNumber = phone.Value<string>() };
                            currentContact.Phones.Add(currentPhone);
                        }
                    }

                    if (contact["emails"] != null)
                    {
                        foreach (var email in contact["emails"])
                        {
                            var currentEmail = new Email() { EmailAddress = email.Value<string>() };
                            currentContact.Emails.Add(currentEmail);
                        }
                    }
                    context.Contacts.Add(currentContact);
                    context.SaveChanges();
                    Console.WriteLine("Contact {0} imported", contact["name"].Value<string>());
                }
                else
                {
                    Console.WriteLine("Error: Name is required");
                }
            }
        }
        static void Main()
        {
            var context = new PhonebookContext();

            var contacts = context.Contacts
                .Select(c => new
                {
                    c.Name,
                    c.Emails,
                    c.Phones
                });

            foreach (var contact in contacts)
            {
                Console.WriteLine("Contact name : {0}", contact.Name);

                Console.WriteLine("Emails:");
                foreach (var email in contact.Emails)
                {
                    Console.WriteLine("    {0}", email.EmailAddress);
                }

                Console.WriteLine("Phones:");
                foreach (var phone in contact.Phones)
                {
                    Console.WriteLine("    {0}", phone.PhoneNumber);
                }
            }
        }