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