Exemple #1
0
        static void Main(string[] args)
        {
            var DbContext = new VidzyDbContext();

            DbContext.AddVideo("Zurassic World", new DateTime(2016, 9, 23), 1, 1);
            DbContext.AddVideo("The Lord of The Rings", new DateTime(2001, 6, 12), 4, 2);
            DbContext.AddVideo("The Hateful Eight", new DateTime(2007, 8, 9), 4, 3);
            DbContext.SaveChanges();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var dbContext = new VidzyDbContext();

            dbContext.Videos.Add(new Video()
            {
                Name = "Pendulum", ReleaseDate = DateTime.Now
            });
            dbContext.SaveChanges();

            foreach (var video in dbContext.Videos)
            {
                Console.WriteLine($"{video.Name} - {video.ReleaseDate}");
            }
        }