Пример #1
0
        static void Main(string[] args)
        {
            var context = new DataBaseFirstDemoEntities();
            var post    = new Post()
            {
                Body          = " Body",
                DatePublished = DateTime.Now,
                Title         = "Title",
                PostID        = 1
            };

            context.Posts.Add(post);
            context.SaveChanges();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var context = new DataBaseFirstDemoEntities();


            var student = new Student()
            {
                Name      = "Nisar Ahmed",
                Programe  = "BS(CS)",
                Date      = DateTime.Now,
                StudentId = 1
            };

            context.Students.Add(student);


            context.SaveChanges();
        }