void deleteActor(string ID) { if(ID!=null) { var p = new Person { PersonId = new Guid(ID) }; Person.Attach(p); Person.Remove(p); SaveChanges(); } }
Person createOrUpdateActor(Person p) { if(p.PersonId != null) { Entry(p).State = EntityState.Modified; SaveChanges(); } else { Person.Add(p); } return p; }