Example #1
0
        static void Main(string[] args)
        {
            using (var context = new Model.NorthwindDataModel())
            {

                var rr = (from c in context.Regions
                          select c.RegionID).Max();


                context.Database.Log = (s) =>
                {
                    Console.WriteLine(s); 
                };

                var region = (from c in context.Regions
                             where c.RegionID == 5
                             select c).FirstOrDefault();


                context.Regions.Remove(region);
                context.SaveChanges();
                Console.WriteLine(region.RegionID); 
            }
        


        }
Example #2
0
        static void DemoLoad()
        {
            using (var context = new Model.NorthwindDataModel())
            {
                var regiones = (from c in context.Regions.Include("Territories")
                                select c).ToList();
                Helper(regiones);
            }

        }