public bool Match(Pilot pilot) { foreach (int points in _points) { if (pilot.Points == points) { return true; } } return pilot.Name.StartsWith("Rubens"); }
public static void StoreSecondPilot(IObjectContainer db) { Pilot pilot2 = new Pilot("Rubens Barrichello", 99); db.Store(pilot2); Console.WriteLine("Stored {0}", pilot2); }
public static void StoreFirstPilot(IObjectContainer db) { Pilot pilot1 = new Pilot("Michael Schumacher", 100); db.Store(pilot1); Console.WriteLine("Stored {0}", pilot1); }
public static void RetrieveByDefaultFieldValue(IObjectContainer db) { Pilot somebody = new Pilot("Somebody else", 0); db.Store(somebody); IQuery query = db.Query(); query.Constrain(typeof(Pilot)); query.Descend("_points").Constrain(0); IObjectSet result = query.Execute(); ListResult(result); db.Delete(somebody); }
public bool Match(Pilot pilot) { return(pilot.Points > 99 && pilot.Points < 199 || pilot.Name == "Rubens Barrichello"); }
public bool Match(Pilot pilot) { return pilot.Points > 99 && pilot.Points < 199 || pilot.Name=="Rubens Barrichello"; }
public static void RetrievePilotByExactPoints(IObjectContainer db) { Pilot proto = new Pilot(null, 100); IObjectSet result = db.QueryByExample(proto); ListResult(result); }
public static void RetrievePilotByName(IObjectContainer db) { Pilot proto = new Pilot("Michael Schumacher", 0); IObjectSet result = db.QueryByExample(proto); ListResult(result); }
public static void RetrieveAllPilotQBE(IObjectContainer db) { Pilot proto = new Pilot(null, 0); IObjectSet result = db.QueryByExample(proto); ListResult(result); }