<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Eric Hauser's Blog</title>
	<atom:link href="http://erichauser.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://erichauser.net</link>
	<description>J2EE, .NET, and general technology</description>
	<pubDate>Fri, 19 Sep 2008 02:09:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Validating method parameters with Castle Validator</title>
		<link>http://erichauser.net/2008/09/18/validating-method-parameters-with-castle-validator/</link>
		<comments>http://erichauser.net/2008/09/18/validating-method-parameters-with-castle-validator/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 02:09:25 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Castle]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=80</guid>
		<description><![CDATA[Been pretty busy at work, so short post. 
I&#8217;ve added a facility in Castle contrib for validating method parameters using Castle Validator.  The goal is to eventually allow have this used for validate parameters in Monorail, but right now I&#8217;m using it to do input validation for web service parameters.  I wrote up a brief blurb [...]]]></description>
			<content:encoded><![CDATA[<p>Been pretty busy at work, so short post. </p>
<p>I&#8217;ve added a facility in Castle contrib for validating method parameters using Castle Validator.  The goal is to eventually allow have this used for validate parameters in Monorail, but right now I&#8217;m using it to do input validation for web service parameters.  I wrote up a brief blurb on how to use it here: <a href="http://using.castleproject.org/display/Contrib/Castle.Facilities.MethodValidator" onclick="javascript:pageTracker._trackPageview ('/outbound/using.castleproject.org');">http://using.castleproject.org/display/Contrib/Castle.Facilities.MethodValidator</a>.  Should be pretty self explanatory.</p>
<p>If anyone finds any issues, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://erichauser.net/2008/09/18/validating-method-parameters-with-castle-validator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Castle Validator Enhancements</title>
		<link>http://erichauser.net/2008/08/28/castle-validator-enhancements/</link>
		<comments>http://erichauser.net/2008/08/28/castle-validator-enhancements/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 00:30:57 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Castle]]></category>

		<category><![CDATA[Validator]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=75</guid>
		<description><![CDATA[I have contributed a couple of enhancements to Castle.Components.Validator that have been committed to the trunk.  Besides using attributes, validations can now be supplied in code using the [ValidateSelf] attribute:

Each of the above validations *could* be done by using an attribute and a custom validator, but expressing validations in code is much simpler for these [...]]]></description>
			<content:encoded><![CDATA[<p>I have contributed a couple of enhancements to Castle.Components.Validator that have been committed to the trunk.  Besides using attributes, validations can now be supplied in code using the [ValidateSelf] attribute:</p>
<p><a href="http://erichauser.net/wp-content/uploads/validateself.jpg"><img class="alignnone size-full wp-image-76" title="validateself" src="http://erichauser.net/wp-content/uploads/validateself.jpg" alt="" /></a></p>
<p>Each of the above validations *could* be done by using an attribute and a custom validator, but expressing validations in code is much simpler for these types of one off validations.  You can have as many methods decorated with [ValidateSelf] on an object you want as long as they have the above method signature (void return and one ErrorSummary parameter).  You can also specify the RunWhen and ExecutionOrder just like regular validators.</p>
<p>The second enhancement is the IValidationContributor interface.  This allows you contribute to the validation of an object beyond the default validation.  The interface is fairly simplistic:</p>
<p><a href="http://erichauser.net/wp-content/uploads/ivalidatorcontributor.jpg"><img class="alignnone size-full wp-image-77" title="ivalidatorcontributor" src="http://erichauser.net/wp-content/uploads/ivalidatorcontributor.jpg" alt="" /></a></p>
<p>You can extend AbstractValidationContributor so that you can perform initialization for a given type.  The SelfValidationContributor implements the logic for recognizing and executing the self validation feature above.  You can write custom contributors that can be injected into the DefaultValidatorRunner for things like retrieving validations from the container and invoking them on the object. </p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://erichauser.net/2008/08/28/castle-validator-enhancements/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NServiceBus Facility Enhancements</title>
		<link>http://erichauser.net/2008/08/23/nservicebus-facility-enhancements/</link>
		<comments>http://erichauser.net/2008/08/23/nservicebus-facility-enhancements/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 14:59:41 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Castle]]></category>

		<category><![CDATA[Idempotent]]></category>

		<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=62</guid>
		<description><![CDATA[I have added a couple of additions to Ayende&#8217;s NServiceBus Facility:

Message handlers and sagas are automatically registered with the container for the defined assemblies
Message handlers are proxied
You can register IHandlerFilter instances with the kernel that allow for interception of messages as they are processed
Using my replay strategy implementation, you can decorate a message handler as [Idempotent(Attemps = 5, [...]]]></description>
			<content:encoded><![CDATA[<p>I have added a couple of additions to <a href="http://www.ayende.com/Blog/archive/2008/07/13/Putting-the-container-to-work-Refactoring-NServiceBus-configuration.aspx" title="NServiceBus Facility" onclick="javascript:pageTracker._trackPageview ('/outbound/www.ayende.com');">Ayende&#8217;s NServiceBus Facility</a>:</p>
<ul>
<li>Message handlers and sagas are automatically registered with the container for the defined assemblies</li>
<li>Message handlers are proxied</li>
<li>You can register IHandlerFilter instances with the kernel that allow for interception of messages as they are processed</li>
<li>Using my replay strategy implementation, you can decorate a message handler as [Idempotent(Attemps = 5, Delay = 2000)].  That means that a message will be retried when an exception is thrown processing the message 5 times, delaying 2 seconds between each retry.  This could also be extended so that depending on the type of exception that is being thrown, a default retry strategy is applied.</li>
</ul>
<p><a href="http://erichauser.net/wp-content/uploads/idempotent_attribute1.jpg"><img class="alignnone size-full wp-image-71" title="idempotent_attribute1" src="http://erichauser.net/wp-content/uploads/idempotent_attribute1.jpg" alt="" /></a></p>
<ul>
<li>The bus is started automatically once all handler dependencies have been satisfied</li>
</ul>
<p>There were a couple of interesting things that I found when implementing this.  One, NServiceBus retrieives handlers from the kernel using the concrete class instance (looking back Ayende noted this as &#8220;yuck&#8221;).  That means that we cannot proxy the interface, but instead have to create a class proxy for our message handlers.  That means that when we the message handlers, we have to verify that the message handler methods are virtual and give a nice error if they are not:</p>
<p><a href="http://erichauser.net/wp-content/uploads/registerhandlers.jpg"><img class="alignnone size-full wp-image-65" title="registerhandlers" src="http://erichauser.net/wp-content/uploads/registerhandlers.jpg" alt="" /></a></p>
<p>Very easy to do with Castle&#8217;s fluent interface for registration.  Sagas, on the other hand, have to be registered in the container by each of their interfaces because saga instances are retrieve by calling builder.Build&lt;ISaga&lt;SomeMessage&gt;&gt;().</p>
<p>Out of the box, the way to do message interception with NSB is to have message handlers chained in a specified order.  The IHandlerFilter provides another method for message interception.  If you have a new filter to add, all you have to do is register the IHandlerFilter instance with the container:</p>
<p><a href="http://erichauser.net/wp-content/uploads/handlerfilter1.jpg"><img class="alignnone size-full wp-image-67" title="handlerfilter1" src="http://erichauser.net/wp-content/uploads/handlerfilter1.jpg" alt="" /></a></p>
<p>The filters follow the chain of responsibility pattern, so they can be short circuited &#8212; which is the same as calling bus.DoNotContinueDispatchingCurrentMessageToHandlers().</p>
<p>I have attached the updates to the post: <a href="http://erichauser.net/wp-content/uploads/nservicebus-fullduplex-xml-update.zip">nservicebus-fullduplex-xml-update</a>.  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://erichauser.net/2008/08/23/nservicebus-facility-enhancements/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Profiling MSTest (and why I had to do it)</title>
		<link>http://erichauser.net/2008/08/22/profiling-mstest-and-why-i-had-to-do-it/</link>
		<comments>http://erichauser.net/2008/08/22/profiling-mstest-and-why-i-had-to-do-it/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 21:04:46 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=55</guid>
		<description><![CDATA[I got an email earlier this week from a member of our team saying that they had noticed odd behavior in our unit tests.  They said when the ran the tests from Visual Studio, the memory allocation increased by about 500MB.  When they ran the tests again, the memory increased another 500MB, and so forth.  [...]]]></description>
			<content:encoded><![CDATA[<p>I got an email earlier this week from a member of our team saying that they had noticed odd behavior in our unit tests.  They said when the ran the tests from Visual Studio, the memory allocation increased by about 500MB.  When they ran the tests again, the memory increased another 500MB, and so forth.  The system component that developer was working on had the most tests out of all of our components, so he was noticing this before others did. </p>
<p>First of all, it seemed odd that unit tests would cause Visual Studio&#8217;s memory to increase since the tests are run in another process.  I knew it would probably be impossible to profile Visual Studio itself, so I profiled out tests from the command line to see what if anything I could figure out.  A couple of tricks to profiling MSTest.exe:</p>
<ul>
<li>Launch mstest.exe with the /noisolation option so that the tests are run in process</li>
<li>When you use the /noisolation option, you have to replace \Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe.config with the App.config for your tests.  You also need to add the this:</li>
</ul>
<p>    &lt;runtime&gt;<br />
        &lt;assemblyBinding xmlns=&#8221;urn:schemas-microsoft-com:asm.v1&#8243;&gt;<br />
            &lt;probing privatePath=&#8221;PrivateAssemblies;PublicAssemblies&#8221;/&gt;<br />
        &lt;/assemblyBinding&gt;<br />
    &lt;/runtime&gt;</p>
<p>The first thing I noticed after all of the tests ran was that 98% of the memory was being held by System.String.  When I looked to see what objects were referencing System.String, one thing blaringly stood out:</p>
<p> <br />
<a href="http://erichauser.net/wp-content/uploads/dottrace1.jpg"><img class="alignnone size-full wp-image-57" title="dottrace1" src="http://erichauser.net/wp-content/uploads/dottrace1.jpg" alt="" width="500" height="160" /></a></p>
<p>All of the standard out was being held in a single member variable from the whole test run.  Since I was not sure if Visual Studio was doing the same thing, I turned off logging in our application and ran the tests again.  Surprise, that worked.  Visual Studio no longer was increasing in memory usage.</p>
<p>Yes, I realize 800 MB of log output is a lot but that is not really the issue &#8211; I&#8217;m not sure why VS keeps that output in memory.  Once it has the test results, I believe it writes it out to a file so why keep it around?</p>
]]></content:encoded>
			<wfw:commentRss>http://erichauser.net/2008/08/22/profiling-mstest-and-why-i-had-to-do-it/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ActiveRecord Session Scope and WCF Redux</title>
		<link>http://erichauser.net/2008/08/06/activerecord-session-scope-and-wcf-redux/</link>
		<comments>http://erichauser.net/2008/08/06/activerecord-session-scope-and-wcf-redux/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 03:10:36 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Active Record]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=57</guid>
		<description><![CDATA[Awhile ago, I posted a solution I was using for a project for managing SessionScope with WCF using an ICallContextInitializer. Because of another issue in the codebase (an error in a custom listener), an exception was getting thrown when session.Dispose() was called in the AfterInvoke method.&#160; What was interesting was that it appeared to the [...]]]></description>
			<content:encoded><![CDATA[<p>Awhile ago, I posted a solution I was using for a project for managing SessionScope with WCF using an ICallContextInitializer. Because of another issue in the codebase (an error in a custom listener), an exception was getting thrown when session.Dispose() was called in the AfterInvoke method.&#160; What was interesting was that it appeared to the client that the WCF call had completed successfully &#8212; even though this was not the case.&#160; It turns out that ICallContextInitializer is not the best WCF extension to use to manage the scope.  Here&#8217;s a quick console application that will show the behavior of throwing an exception in AfterInvoke.  Notice how the console window will crash before the ReadKey is hit:  &#160; </p>
<p>&#160;</p>
<div>
<div style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%;">
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">   1:</span> <span style="color: #0000ff;">class</span> Program</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">   2:</span> {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">   3:</span>     <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> Main(<span style="color: #0000ff;">string</span>[] args)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">   4:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">   5:</span>         <span style="color: #0000ff;">using</span> (var host = <span style="color: #0000ff;">new</span> ServiceHost(<span style="color: #0000ff;">typeof</span>(Operation)))</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">   6:</span>         {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">   7:</span>             var endpointAddress = <span style="color: #0000ff;">new</span> EndpointAddress(<span style="color: #006080;">"net.tcp://localhost/optest"</span>);</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">   8:</span>             var endpoint = <span style="color: #0000ff;">new</span> ServiceEndpoint(ContractDescription.GetContract(<span style="color: #0000ff;">typeof</span>(IOperation)),</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">   9:</span>                                                <span style="color: #0000ff;">new</span> NetTcpBinding(),</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  10:</span>                                                endpointAddress);</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  11:</span>             endpoint.Behaviors.Add(<span style="color: #0000ff;">new</span> ThrowBehavior());</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  12:</span>             host.Description.Endpoints.Add(endpoint);</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  13:</span>             host.Open();</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  14:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  15:</span>             var op = ChannelFactory&lt;IOperation&gt;.CreateChannel(<span style="color: #0000ff;">new</span> NetTcpBinding(), endpointAddress);</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  16:</span>             op.Op();</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  17:</span>         }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  18:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  19:</span>         Console.ReadKey();</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  20:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  21:</span> }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  22:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  23:</span>
 [ServiceContract]</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  24:</span> <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">interface</span> IOperation</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  25:</span> {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  26:</span>     [OperationContract]</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  27:</span>     <span style="color: #0000ff;">void</span> Op();</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  28:</span> }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  29:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  30:</span> <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> Operation : IOperation</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  31:</span> {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  32:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> Op()</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  33:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  34:</span>     } </pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  35:</span> }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  36:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  37:</span> <span style="color: #0000ff;">internal</span> <span style="color: #0000ff;">class</span> ThrowBehavior : IEndpointBehavior</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  38:</span> {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  39:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> Validate(ServiceEndpoint endpoint)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  40:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  41:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  42:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  43:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  44:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  45:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  46:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  47:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> Apply
DispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  48:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  49:</span>         <span style="color: #0000ff;">foreach</span> (DispatchOperation operation <span style="color: #0000ff;">in</span> endpointDispatcher.DispatchRuntime.Operations)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  50:</span>         {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  51:</span>             operation.CallContextInitializers.Add(<span style="color: #0000ff;">new</span> ThrowCallContextInitializer());</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  52:</span>         }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  53:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  54:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  55:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  56:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  57:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  58:</span> }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  59:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  60:</span> <span style="color: #0000ff;">internal</span> <span style="color: #0000ff;">class</span> ThrowCallContextInitializer : ICallContextInitializer</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  61:</span> {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  62:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">object</span> BeforeInvoke(InstanceContext instanceContext, IClientChannel channel, Message message)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  63:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  64:</span>         <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">null</span>;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  65:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  66:</span> &nbsp;</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  67:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> AfterInvoke(<span style="color: #0000ff;">object</span> correlationState)</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">  68:</span>     {</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  69:</span>         <span style="color: #0000ff;">throw</span> <span style="color: #0000ff;">new</span> InvalidOperationException();</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em;"><span style="color: #606060;">
  70:</span>     }</pre>
<pre style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;"><span style="color: #606060;">  71:</span> }</pre>
</div>
</div>
<p>&#160;</p>
<p>My revised code uses a DispatchMessageInterceptor instead:</p>
<p>&#160;</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ARSessionScopeBehavior : IEndpointBehavior</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>     </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>     <span style="color: #008000">/// Implement to pass data at runtime to bindings to support custom behavior.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>     <span style="color: #008000">/// &lt;param name=&quot;endpoint&quot;&gt;The endpoint to modify.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>     <span style="color: #008000">/// &lt;param name=&quot;bindingParameters&quot;&gt;The objects that binding elements require to support the behavior.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>     <span style="color: #008000">/// Implements a modification or extension of the service across an endpoint.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>     <span style="color: #008000">/// &lt;param name=&quot;endpoint&quot;&gt;The endpoint that exposes the contract.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     <span style="color: #008000">/// &lt;param name=&quot;endpointDispatcher&quot;&gt;The endpoint dispatcher to be modified or extended.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>         endpointDispatcher.DispatchRuntime.MessageInspectors.Add(<span style="color: #0000ff">new</span> ARDispatcherMessageInspector());</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>     <span style="color: #008000">/// Implements a modification or extension of the client across an endpoint.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>     <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>     <span style="color: #008000">/// &lt;param name=&quot;endpoint&quot;&gt;The endpoint that is to be customized.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>     <span style="color: #008000">/// &lt;param name=&quot;clientRuntime&quot;&gt;The client runtime to be customized.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>     <span style="color: #008000">/// Implement to confirm that the endpoint meets some intended criteria.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>     <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>     <span style="color: #008000">/// &lt;param name=&quot;endpoint&quot;&gt;The endpoint to validate.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> Validate(ServiceEndpoint endpoint)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span> }</pre>
</p></div>
</div>
<p>&#160;</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ARDispatchMessageInspector : IDispatchMessageInspector</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>  {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>      <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> ILogger Logger = LogManager.GetLogger(ARDispatchMessageInspector);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>      <span style="color: #0000ff">private</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> ActiveRecordSessionScopeKey = <span style="color: #006080">&quot;wcf.ar.sessionscope&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>      <span style="color: #cc6633">#region</span> Implementation of IDispatchMessageInspector</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>      <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>      <span style="color: #008000">/// Called after an inbound message has been received but before the message is dispatched to the intended operation.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>      <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>      <span style="color: #008000">/// &lt;returns&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>      <span style="color: #008000">/// The object used to correlate state. This object is passed back in the &lt;see cref=&quot;M:System.ServiceModel.Dispatcher.IDispatchMessageInspector.BeforeSendReply(System.ServiceModel.Channels.Message@,System.Object)&quot; /&gt; method.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>      <span style="color: #008000">/// &lt;/returns&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>      <span style="color: #008000">/// &lt;param name=&quot;request&quot;&gt;The request message.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>      <span style="color: #008000">/// &lt;param name=&quot;channel&quot;&gt;The incoming channel.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>      <span style="color: #008000">/// &lt;param name=&quot;instanceContext&quot;&gt;The current service instance.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>      <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> AfterReceiveRequest(<span style="color: #0000ff">ref</span> Message request, IClientChannel channel, InstanceContext instanceContext)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>      {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>          var scope = Local.Data[ActiveRecordSessionScopeKey] <span style="color: #0000ff">as</span> SessionScope;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>          <span style="color: #0000ff">if</span> (scope == <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>          {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>              Logger.Debug(<span style="color: #006080">&quot;Creating new ActiveRecord SessonScope&quot;</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>              scope = <span style="color: #0000ff">new</span> SessionScope();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>              Local.Data[ActiveRecordSessionScopeKey] = scope;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>          }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>          <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>      }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>      <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>      <span style="color: #008000">/// Called after the operation has returned but before the reply message is sent.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>      <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>      <span style="color: #008000">/// &lt;param name=&quot;reply&quot;&gt;The reply message. This value is null if the operation is one way.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>      <span style="color: #008000">/// &lt;param name=&quot;correlationState&quot;&gt;The correlation object returned from the &lt;see cref=&quot;M:System.ServiceModel.Dispatcher.IDispatchMessageInspector.AfterReceiveRequest(System.ServiceModel.Channels.Message@,System.ServiceModel.IClientChannel,System.ServiceModel.InstanceContext)&quot; /&gt; method.&lt;/param&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>      <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> BeforeSendReply(<span style="color: #0000ff">ref</span> Message reply, <span style="color: #0000ff">object</span> correlationState)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>      {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>          var scope = Local.Data[ActiveRecordSessionScopeKey] <span style="color: #0000ff">as</span> SessionScope;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>          <span style="color: #0000ff">if</span> (scope != <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span>          {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  41:</span>              <span style="color: #0000ff">if</span> (SessionScope.Current == scope)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  42:</span>              {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  43:</span>                  Logger.Debug(<span style="color: #006080">&quot;Disposing ActiveRecord SessonScope&quot;</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  44:</span>                  scope.Dispose();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  45:</span>              }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  46:</span>              <span style="color: #0000ff">else</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  47:</span>              {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  48:</span>                  Logger.Warn(</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  49:</span>                      <span style="color: #006080">&quot;The current Active Record session scope does not equal the correlated session scope from WCF.  This scope will not &quot;</span> +</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  50:</span>                      <span style="color: #006080">&quot;be disposed, however, this could lead to entities not being properly flushed.&quot;</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  51:</span>              }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  52:</span>              Local.Data[ActiveRecordSessionScopeKey] = <span style="color: #0000ff">null</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  53:</span>          }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  54:</span>      }</pre>
</p></div>
</div>
<p>&#160;</p>
<p>So far, no problems.&#160; Funny enough, when searching for solutions to this problem, I noticed some other posts where people recommended using the ICallContextInitializer to manage unit of work.&#160; I assume they just have not had any issues when calling Dispose() and have not seen this behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://erichauser.net/2008/08/06/activerecord-session-scope-and-wcf-redux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Advanced ActiveRecord Models - Part 2</title>
		<link>http://erichauser.net/2008/07/09/advanced-activerecord-models-part-2/</link>
		<comments>http://erichauser.net/2008/07/09/advanced-activerecord-models-part-2/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 02:42:48 +0000</pubDate>
		<dc:creator>ehauser</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Active Record]]></category>

		<guid isPermaLink="false">http://erichauser.net/?p=56</guid>
		<description><![CDATA[In part 1, I discussed what Castle ActiveRecord does when starting up and ways you can modify the model after is has been generated.&#160; Another useful trick is to add custom attributes to your model that can be inspected while ActiveRecord is inspecting its model.&#160; To this you need to create a class that implements [...]]]></description>
			<content:encoded><![CDATA[<p>In part 1, I discussed what Castle ActiveRecord does when starting up and ways you can modify the model after is has been generated.&#160; Another useful trick is to add custom attributes to your model that can be inspected while ActiveRecord is inspecting its model.&#160; To this you need to create a class that implements Castle.ActiveRecord.Framework.Internal.IModelBuilderExtension and register it with the ActiveRecordStarter.</p>
<p>&#160;</p>
<p>For my example, let&#8217;s assume that we want to implement soft deletes using ActiveRecord.&#160; The NHibernate FAQ has a <a href="http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/08/soft-deletes.aspx" onclick="javascript:pageTracker._trackPageview ('/outbound/blogs.hibernatingrhinos.com');">great blog entry</a> on how to make NHibernate mark a entity as deleted as opposed to deleting it from the database.&#160; Assuming you are using their model of marking your entities as ISoftDeleteable, here are two things we can do to extend this model:</p>
<p>&#160;</p>
<ol>
<li>If session.Get(id) is called on soft deleted record, null is returned. </li>
<li>If a collection contains a record that has been soft deleted, that record will not show up when the collection is loaded. </li>
</ol>
<p>&#160;</p>
<p>I am not entirely sure that these two features are something that you want to necessarily do, however, they are good examples for what I am trying to show.&#160; The reason I say that is because I am not sure you want entities showing up sometimes and not other times, i.e. a soft deleted model would show up for a custom query unless someone checks the Deleted flag, how do soft deletes work across entity graphs, should we allow both ends of a bidirectional relationship to be soft deleteable, etc.&#160; So, I have kept this example limited too two easy features, but remember to think about this a little more before actually implementing it.&#160; So on to the example, the first thing we need to is to add a custom model builder to inspect our model:</p>
<p>&#160;</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> SoftDeleteModelBuilderExtension : IModelBuilderExtension</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> IDictionary&lt;Type, SoftDeleteModel&gt; SoftDeleteModels = <span style="color: #0000ff">new</span> Dictionary&lt;Type, SoftDeleteModel&gt;();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     <span style="color: #cc6633">#region</span> IModelBuilderExtension Members</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessBelongsTo(System.Reflection.PropertyInfo pi, BelongsToModel belongsToModel, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessClass(Type type, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>         GetModel(type, model);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessField(System.Reflection.FieldInfo fi, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessHasAndBelongsToMany(System.Reflection.PropertyInfo pi, HasAndBelongsToManyModel hasAndBelongManyModel, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>         <span style="color: #0000ff">if</span> (!IsSoftModel(hasAndBelongManyModel.HasManyAtt.MapType)) <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>         var softDeleteModel = GetModel(model.Type, model);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>         softDeleteModel.HasAndBelongsToMany.Add(hasAndBelongManyModel);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessHasMany(System.Reflection.PropertyInfo pi, HasManyModel hasManyModel, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>         <span style="color: #0000ff">if</span> (!IsSoftModel(hasManyModel.HasManyAtt.MapType)) <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>         var softDeleteModel = GetModel(model.Type, model);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>         softDeleteModel.HasMany.Add(hasManyModel);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessHasManyToAny(System.Reflection.PropertyInfo pi, HasManyToAnyModel hasManyModel, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>         <span style="color: #0000ff">if</span> (!IsSoftModel(hasManyModel.HasManyToAnyAtt.MapType)) <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>         var softDeleteModel = GetModel(model.Type, model);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>         softDeleteModel.ManyToAny.Add(hasManyModel);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  41:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  42:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ProcessProperty(System.Reflection.PropertyInfo pi, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  43:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  44:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  45:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  46:</span>     <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">bool</span> IsSoftModel(Type type)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  47:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  48:</span>         <span style="color: #0000ff">return</span> (<span style="color: #0000ff">typeof</span>(ISoftDeleteable).IsAssignableFrom(type));</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  49:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  50:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  51:</span>     <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> SoftDeleteModel GetModel(Type type, ActiveRecordModel model)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  52:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  53:</span>         SoftDeleteModel softDeleteModel;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  54:</span>         SoftDeleteModels.TryGetValue(type, <span style="color: #0000ff">out</span> softDeleteModel);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  55:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  56:</span>         <span style="color: #0000ff">if</span> (softDeleteModel == <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  57:</span>         {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  58:</span>             softDeleteModel = <span style="color: #0000ff">new</span> SoftDeleteModel {Type = type, ActiveRecordModel = model};</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  59:</span>             <span style="color: #0000ff">if</span> (IsSoftModel(type))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  60:</span>                 softDeleteModel.SoftDeleteable = <span style="color: #0000ff">true</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  61:</span>             SoftDeleteModels[type] = softDeleteModel;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  62:</span>         }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  63:</span>         <span style="color: #0000ff">return</span> softDeleteModel;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  64:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  65:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  66:</span>     <span style="color: #cc6633">#endregion</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  67:</span> }</pre>
</p></div>
</div>
<p>&#160;</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> SoftDeleteModel</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #008000">/// Gets or sets the type.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>     <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     <span style="color: #008000">/// &lt;value&gt;The type.&lt;/value&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">public</span> Type Type { get; set; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     <span style="color: #008000">/// Gets or sets a value indicating whether the model is soft deleteable.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courie