Figaro - The XML Database for the .NET Framework
CopyC#
The evaluation type defines how much work Figaro performs as a part of the query, and how much it defers until the results are evaluated. There are two evaluation types:
| Evaluation Type | Description |
|---|---|
| Eager | The query is executed and its resultant values are derived and stored in-memory before the query returns. This is the default. |
| Lazy | Minimal processing is performed before the query returns, and the remaining processing is deferred until you enumerate over the result set. |
You can set the evaluation when creating the QueryContext object, or you can set the property after initialization.
using Figaro.BerkeleyDB.Xml; namespace Figaro.Documentation.Examples { class SampleSetEvaluationType { static void Main() { XmlManager mgr = new XmlManager(); Container myContainer = mgr.OpenContainer(@"C:\dev\db\exampleData.dbxml"); //we can set the evaluation type at initialization... QueryContext queryContext = mgr.CreateQueryContext(EvaluationType.Eager); //...or we can set it at design time. queryContext.EvaluationType = EvaluationType.Lazy; } } }