using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LinqSqlEpisodeVIIProVid
{
    class Program
    {
        static void Main(string[] args)
        {
            NorthwindDataContext northwind = new NorthwindDataContext();

            Customer myCustomer = northwind.Customers.Where(c => c.CustomerID == "ALFKI").Single();
            myCustomer.ContactName = "Morteza Giti";
            myCustomer.Phone = "09336863931";

            Order order = new Order();
            order.OrderDate = DateTime.Now;
            order.RequiredDate = DateTime.Now.AddDays(5);
            order.ShipCity = "Shiraz";
            order.ShipPostalCode = "323423257";

            myCustomer.Orders.Add(order);
            northwind.SubmitChanges();
            Console.WriteLine("Updated");
            Console.ReadKey();
        }
    }
}
