Inheritance: OptimizedPersistable
Exemple #1
0
 public Person(string firstName, string lastName, UInt16 age, Person bestFriend = null)
 {
   this.firstName = firstName;
   this.lastName = lastName;
   this.age = age;
   this.bestFriend = bestFriend;
 }
Exemple #2
0
 static void Main(string[] args)
 {
   SessionNoServer session = new SessionNoServer(systemDir);
   session.BeginUpdate();
   Person robinHood = new Person("Robin", "Hood", 30);
   Person billGates = new Person("Bill", "Gates", 56, robinHood);
   Person steveJobs = new Person("Steve", "Jobs", 56, billGates);
   robinHood.BestFriend = billGates;
   session.Persist(steveJobs); // the other persons will be persisted implicetly by reachability from "Steve Jobs" person object
   session.Commit();
 }