Esempio n. 1
0
        static void Main(string[] args)
        {
            var vidzyContext = new VidzyEntities();

            vidzyContext.AddVideo("Rocky V", DateTime.Now, 2, (byte)Classification.Platinum);
            vidzyContext.SaveChanges();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var DBContext   = new VidzyEntities();
            var ReleaseDate = new System.DateTime(2008, 3, 9);

            DBContext.AddVideo("Se7en", ReleaseDate, "Horror", (byte)Classification.Platinum);
            DBContext.AddVideo("Watchmen", new System.DateTime(2009, 7, 10), "Action", 2);
        }
Esempio n. 3
0
 static void Main(string[] args)
 {
     using (VidzyEntities context = new VidzyEntities())
     {
         context.AddVideo("Lucy", DateTime.Now.AddYears(-3), "Thriller", (byte)Classification.Gold);
         context.AddVideo("Bahubali 2", DateTime.Now.AddYears(-5), "Action", (byte)Classification.Platinum);
     }
 }
        static void Main(string[] args)
        {
            var vidzy = new VidzyEntities();

            vidzy.AddVideo("Field of Dreams", new DateTime(1999, 1, 1), "Family", 3);
            vidzy.AddVideo("Mask", new DateTime(2001, 1, 15), "Comedy", 2);
            vidzy.AddVideo("Escape From Alcatraz", new DateTime(1999, 12, 22), "Action", 2);
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            var context = new VidzyEntities();

            context.AddVideo("Code with Mosh 4", DateTime.UtcNow.AddDays(-1), "Action", Classification.Platinum);
            context.AddVideo("Code with Mosh 5", DateTime.UtcNow.AddDays(-2), "Action", Classification.Gold);
            context.AddVideo("Code with Mosh 6", DateTime.UtcNow.AddDays(-3), "Action", Classification.Silver);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Modify_DataDirectory_Property();

            using (var context = new VidzyEntities())
            {
                // Add videos to database
                context.AddVideo("Hot Shots", new DateTime(2003, 1, 1), "Comedy", Classification.Gold);
                context.AddVideo("American Gangster", new DateTime(1997, 1, 1), "Action", Classification.Platinum);

                // Save changes
                context.SaveChanges();

                // Display the videos
                foreach (var video in context.Videos)
                {
                    Console.WriteLine(video.Name);
                }
            }
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Console.ReadKey();
            var _context = new VidzyEntities();

            _context.AddVideo("Video1", DateTime.Now, "Comedy");
            _context.AddVideo("Video2", DateTime.Now, "Comedy");
            _context.AddVideo("Video3", DateTime.Now, "Action");
            _context.AddVideo("Video4", DateTime.Now, "Action");
            _context.SaveChanges();

            Console.ReadKey();
            var vids = _context.Videos;

            foreach (var v in vids)
            {
                Console.WriteLine("{0}, {1}, {2}", v.Id, v.Name, v.ReleaseDate);
            }

            Console.ReadKey();
        }