EF真强大

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

namespace EFDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Students objStudent = new Students()
            {
                StudentAddress = "天津市南开区",
                StudentName = "小轩",
                Age = 20,
                Birthday = Convert.ToDateTime("1996-01-01"),
                ClassId = 2,
                Gender = "",
                PhoneNumber = "022-99008877",
                StudentIdNo = 120223199601011213
            };

            EFDBEntities efdb = new EFDBEntities();
            efdb.Students.Add(objStudent);
            int result = efdb.SaveChanges();

            Console.WriteLine(result);
            Console.ReadLine();
        }

        }
    }

 

posted @ 2018-01-12 17:10  爱踢两键  阅读(116)  评论(0编辑  收藏  举报