Example #1
0
 public void Delete(int id)
 {
     using (var db = new FamilyContext()) {
     Person p = new Person();
     p.Id = id;
     db.People.Attach(p);
     db.Entry(p).State = System.Data.EntityState.Deleted;
     int n = db.SaveChanges();
     Debug.Print("delete={0} rows", n);
       }
 }