Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1019

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Retrieving Structured Objects</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Retrieving Structured Objects</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#QBE">QBE</a></li><li><a href ="#Native Queries">Native Queries</a></li><li><a href ="#SODA Query API">SODA Query API</a></li></ul></li></ul></div></div></div><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script>
<a name="QBE"></a><h2>QBE</h2>
<p>To retrieve all cars a simple 'blank' prototype can be used.</p>

<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveAllCarsQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveAllCarsQBE(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveAllCarsQBE_134_70_62_158_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Car proto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(proto);
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p>[/filter] </p>
<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveAllCarsQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveAllCarsQBE()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllCarsQBE_279_70_15_215_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveAllCarsQBE(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> proto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">)
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(proto)
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
<p></span> </p>
<p>You can also query for all pilots, of course.</p>
<p> </p>
<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveAllPilotsQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveAllPilotsQBE()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveAllPilotsQBE_486_72_15_224_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveAllPilotsQBE(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> proto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">, </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(proto)
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<p>Now let's initialize the prototype to specify all cars driven by Rubens 
Barrichello.</p>

<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarByPilotQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveCarByPilotQBE(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_713_73_65_256_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Pilot pilotproto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">,</span><span style="color: #800080;">0</span><span style="color: #000000;">);
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Car carproto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      carproto.Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotproto;
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(carproto);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p></span> </p>
<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveCarByPilotQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveCarByPilotQBE()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_859_73_15_337_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveCarByPilotQBE(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilotproto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> carproto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">)
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            carproto.Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotproto
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(carproto)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<p>What about retrieving a pilot by car? You simply don't need that -if you 
already know the car, you can simply access the pilot field directly.</p>


<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarByPilotQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveCarByPilotQBE(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotQBE_1147_73_65_256_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Pilot pilotproto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">,</span><span style="color: #800080;">0</span><span style="color: #000000;">);
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Car carproto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      carproto.Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotproto;
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(carproto);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p></span> </p>

<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveCarByPilotQBE</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveCarByPilotQBE()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotQBE_1295_73_15_337_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveCarByPilotQBE(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilotproto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> carproto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">)
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            carproto.Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotproto
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Get(carproto)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<a name="Native Queries"></a><h2>Native Queries</h2>
<p>Using native queries with constraints on deep structured objects is 
straightforward, you can do it just like you would in plain other code. 
<br><br>Let's constrain our query to only those cars driven by a Pilot with a 
specific name:</p>


<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarsByPilotNameNative</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveCarsByPilotNameNative(IObjectContainer db) 
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNameNative_1702_81_74_230_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> pilotName </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet results </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> RetrieveCarsByPilotNamePredicate(pilotName));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(results);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarsByPilotNamePredicate</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> RetrieveCarsByPilotNamePredicate : Predicate
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_61_303_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> _pilotName;
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> RetrieveCarsByPilotNamePredicate(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> pilotName)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_165_199_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        _pilotName </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotName;
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> Match(Car candidate)
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarsByPilotNamePredicate_1783_80_246_299_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> candidate.Pilot.Name </span><span style="color: #000000;">==</span><span style="color: #000000;"> _pilotName;
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div> <br></p>
<p></span> </p>

<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveCarsByPilotNameNative</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveCarsByPilotNameNative()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarsByPilotNameNative_1947_81_15_283_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveCarsByPilotNameNative(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilotName </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">String</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> results </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> RetrieveCarsByPilotNamePredicate(pilotName))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(results)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<a name="SODA Query API"></a><h2>SODA Query API </h2>
<p>In order to use SODA for querying for a car given its pilot's name you have to 
descend two levels into our query.</p>



<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarByPilotNameQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveCarByPilotNameQuery(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotNameQuery_2242_79_71_284_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Car));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        .Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p></span> </p>


<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveCarByPilotNameQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveCarByPilotNameQuery()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotNameQuery_2398_79_15_350_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveCarByPilotNameQuery(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Car))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<p>You can also constrain the pilot field with a prototype to achieve the same 
result.</p>



<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrieveCarByPilotProtoQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrieveCarByPilotProtoQuery(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrieveCarByPilotProtoQuery_2635_80_72_301_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Car));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Pilot proto </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</span><span style="color: #000000;">);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(proto);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p></span> </p>


<p><span name="cs_wiki_filter" csw_filters="vb"></p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrieveCarByPilotProtoQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveCarByPilotProtoQuery()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrieveCarByPilotProtoQuery_2792_80_15_387_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveCarByPilotProtoQuery(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Car))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> proto </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(proto)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<p>Descending into a query provides you with another query. Starting out from a 
query root you can descend in multiple directions. In practice this is the same 
as ascending from one child to a parent and descending to another child. The 
queries turn one-directional references in objects into true relations. Here is 
an example that queries for "a Pilot that is being referenced by a Car, where 
the Car model is 'Ferrari'":</p>




<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.cs: <span class="fscMemberName">RetrievePilotByCarModelQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RetrievePilotByCarModelQuery(IObjectContainer db) 
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredCS.ZipsStructuredExample.Cs_StructuredExample.Cs_RetrievePilotByCarModelQuery_3377_80_73_318_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery carQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      carQuery.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Car));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      carQuery.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_model</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery pilotQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> carQuery.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotQuery.Execute();
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
<p></span> </p>



<p>[filter=vb]</p>
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StructuredExample.vb: <span class="fscMemberName">RetrievePilotByCarModelQuery</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrievePilotByCarModelQuery()</span><span id="ResourcesReferenceObject_LifecycleWorking_With_Structured_ObjectsstructuredVB.ZipsStructuredExample.Vb_StructuredExample.Vb_RetrievePilotByCarModelQuery_3502_80_15_403_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrievePilotByCarModelQuery(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> carQuery </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            carQuery.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Car))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            carQuery.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_model</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilotQuery </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> carQuery.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilotQuery.Execute()
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
</span>
<p><img src="graph3.gif"/></p></div>
    </div>
    <div id="footer">
					This revision (8) was last Modified 2006-12-29T15:53:09 by Tetyana.
				</div>
  </body>
</html>