private static void Edit() { Lxrenb lxre = DbEntities.Lxrenb.FirstOrDefault(l => l.xm == "张杰"); ShowInfo(lxre); lxre.xm = "胡睿毅"; ShowInfo(lxre); DbEntities.SaveChanges(); }
private static void Add() { Lxrenb lxr = new Lxrenb { xm = "张杰", lbdm = 1, sjhm = "12345678912", qq = "123456789" }; DbEntities.Lxrenb.Add(lxr); DbEntities.SaveChanges(); }
private static void Delete() { Lxrenb lxren = new Lxrenb { lxrenbh = 2652 }; DbEntities.Lxrenb.Attach(lxren); DbEntities.Lxrenb.Remove(lxren); DbEntities.SaveChanges(); }
private static void Printinfo(Lxrenb m) { Console.WriteLine(m.xm + " " + m.xmsx + " " + m.sjhm + " " + m.qq + " " + m.lbdm); }
public static void ShowInfo(Lxrenb m) { Console.WriteLine(m.xm + " " + m.xmsx + " " + m.sjhm + " " + m.qq + " " + m.lbdm); }