Sophie

Sophie

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

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

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>TypeAlias</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>TypeAlias</h1><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>


<p>TypeAlias
constructor accepts 2 parameters: </p>

<ul>
<li>stored class name - storedType</li>

<li>runtime class name - runtimeType</li>
</ul>

<p>Note that the runtimeType class should exist in your
application when you configure the alias.</p>

<p>The alias matches are found by comparing full names of the stored and
runtime classes</p>


<p>Let's declare a new TypeAlias</p>



<span name="cs_wiki_filter" csw_filters="cs">

<p>c#:</p>

<p><code>private static TypeAlias tAlias;</code></p>
</span>
<span name="cs_wiki_filter" csw_filters="vb">

<p>VB:</p>

<p><code>Private Shared tAlias As TypeAlias</code></p>
</span>

<p>The following method will initialize tAlias and configure db4o to use
it:</p>



<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.cs: <span class="fscMemberName">ConfigureClassAlias</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63"><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;">static</span><span style="color: #000000;"> IConfiguration ConfigureClassAlias()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_ConfigureClassAlias_808_63_60_851_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: #008000;">//</span><span style="color: #008000;"> create a new alias</span><span style="color: #008000;">
</span><span style="color: #008080;">04</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            tAlias </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> TypeAlias(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Pilot, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Driver, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</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: #008000;">//</span><span style="color: #008000;"> add the alias to the db4o configuration </span><span style="color: #008000;">
</span><span style="color: #008080;">06</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            IConfiguration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration();
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            configuration.AddAlias(tAlias);
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">//</span><span style="color: #008000;"> check how does the alias resolve</span><span style="color: #008000;">
</span><span style="color: #008080;">09</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Stored name for Db4objects.Db4odoc.Aliases.Driver: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> tAlias.ResolveRuntimeName(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Driver, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">));
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Runtime name for Db4objects.Db4odoc.Aliases.Pilot: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> tAlias.ResolveStoredName(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Pilot, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">));
</span><span style="color: #008080;">11</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;"> configuration;
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>

<span name="cs_wiki_filter" csw_filters="vb">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.vb: <span class="fscMemberName">ConfigureClassAlias</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63"><div><!--

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

--><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_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="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function ConfigureClassAlias()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_ConfigureClassAlias_937_63_15_862_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> ConfigureClassAlias() </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">'</span><span style="color: #008000;"> create a new alias</span><span style="color: #008000;">
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            tAlias </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> TypeAlias(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Pilot, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Driver, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</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: #008000;">'</span><span style="color: #008000;"> add the alias to the db4o configuration </span><span style="color: #008000;">
</span><span style="color: #008080;">05</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration()
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            configuration.AddAlias(tAlias)
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">'</span><span style="color: #008000;"> check how does the alias resolve</span><span style="color: #008000;">
</span><span style="color: #008080;">08</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Stored name for Db4objects.Db4odoc.Aliases.Driver: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> tAlias.ResolveRuntimeName(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Driver, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</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"/>            Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Runtime name for Db4objects.Db4odoc.Aliases.Pilot: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> tAlias.ResolveStoredName(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4objects.Db4odoc.Aliases.Pilot, Db4objects.Db4odoc</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
</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;">Return</span><span style="color: #000000;"> configuration
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div>


</span>

<p>We can always check the results of adding an alias using
resolveRuntimeName and resolveStoredName as you see in the example. Basically
the same methods are used internally by db4o to resolve aliased names.</p>



<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.cs: <span class="fscMemberName">SaveDrivers</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55"><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;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> SaveDrivers(IConfiguration configuration)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_70_518_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"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer db </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(configuration, Db4oFileName);
</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;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_224_432_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"/>                Driver driver </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Driver(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">David Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">99</span><span style="color: #000000;">);
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(driver);
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                driver </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Driver(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Kimi Raikkonen</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(driver);
</span><span style="color: #008080;">11</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;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">finally</span><span style="color: #000000;">
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_SaveDrivers_1290_55_465_508_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Close();
</span><span style="color: #008080;">15</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;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.vb: <span class="fscMemberName">SaveDrivers</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55"><div><!--

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

--><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_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="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub SaveDrivers()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_SaveDrivers_1413_55_15_493_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> SaveDrivers(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</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;">Dim</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(configuration, Db4oFileName)
</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: #0000FF;">Try</span><span style="color: #000000;">
</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;">Dim</span><span style="color: #000000;"> driver </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Driver </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Driver(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">David Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">99</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(driver)
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                driver </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Driver(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Kimi Raikkonen</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(driver)
</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: #0000FF;">Finally</span><span style="color: #000000;">
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Close()
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">12</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>Due to the alias
configured the database will have Pilot classes saved. You can check it using
ObjectManager or you can remove alias and read it from the database:</p>



<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.cs: <span class="fscMemberName">RemoveClassAlias</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60"><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;"> RemoveClassAlias(IConfiguration configuration)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_RemoveClassAlias_1716_60_75_133_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"/>            configuration.RemoveAlias(tAlias);
</span><span style="color: #008080;">4</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">AliasExample.cs: <span class="fscMemberName">GetPilots</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49"><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;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> GetPilots(IConfiguration configuration)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_68_381_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"/>            IObjectContainer db </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(configuration, Db4oFileName);
</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: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_183_295_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">06</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.Query(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                ListResult(result);
</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: #0000FF;">finally</span><span style="color: #000000;">
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsAliasExample.Cs_AliasExample.Cs_GetPilots_1780_49_328_371_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Close();
</span><span style="color: #008080;">12</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;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div> <br></p>

</span>


<span name="cs_wiki_filter" csw_filters="vb">



<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.vb: <span class="fscMemberName">RemoveClassAlias</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60"><div><!--

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

--><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_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="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RemoveClassAlias()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_RemoveClassAlias_1908_60_15_136_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RemoveClassAlias(</span><span style="color: #0000FF;">ByRef</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            configuration.RemoveAlias(tAlias)
</span><span style="color: #008080;">3</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>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">AliasExample.vb: <span class="fscMemberName">GetPilots</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49"><div><!--

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

--><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_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="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub GetPilots()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsAliasExample.Vb_AliasExample.Vb_GetPilots_1972_49_15_385_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> GetPilots(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration)
</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;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(configuration, Db4oFileName)
</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;">Try</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"/>                </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(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Db4objects.Db4odoc.Aliases.Pilot))
</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/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Finally</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"/>                db.Close()
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">9</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> <br></p>


</span>

<p>Obvioulsly you can install the same alias again and read the stored
objects using Driver class.</p>




</div>
    </div>
    <div id="footer">
					This revision (3) was last Modified 2008-01-12T12:15:54 by Tetyana.
				</div>
  </body>
</html>