Exemple #1
0
 private static void PostPerson()
 {
     Console.WriteLine("Post Person");
     Container c = new Container();
     Person person = new Person { FirstName = "Eric", LastName = "Smith", Age = 8 };
     c.AddToPeople(person);
     c.SaveChanges();
     Console.WriteLine("\t{0}, {1} was added", person.FirstName, person.LastName);
     GetPeople();
 }
Exemple #2
0
 private static void DeletePerson()
 {
     Console.WriteLine("Delete Person");
     Container c = new Container();
     var person = c.People.Where(p => p.FirstName == "Eric" && p.LastName == "Smith").Single();
     c.DeleteObject(person);
     c.SaveChanges();
     Console.WriteLine("\t{0}, {1} was deleted", person.FirstName, person.LastName);
     GetPeople();
 }
Exemple #3
0
 private static void PatchPerson()
 {
     Console.WriteLine("Patch Person");
     Container c = new Container();
     var person = c.People.Where(p => p.FirstName == "Eric" && p.LastName == "Smith").Single();
     person.Age = 9;
     c.UpdateObject(person);
     c.SaveChanges();
     Console.WriteLine("\t{0}, {1}'s age is changed to {2}", person.FirstName, person.LastName, person.Age);
     GetPeople();
 }