<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6406442277861689963</id><updated>2024-09-13T23:00:46.812+01:00</updated><category term=".NET"/><category term="IoC"/><category term="Architecture"/><category term="Entity Framework"/><category term="WCF"/><category term="Ninject"/><category term="SQL Server"/><category term="Spring"/><category term="Sync Framework"/><category term="Unity"/><category term="Career"/><category term="DataSets"/><category term="Linq"/><category term="MVVM"/><category term="Quartz"/><category term="RIA Services"/><category term="Spring.NET"/><category term="StructureMap"/><category term="Training"/><category term="WPF"/><category term="Winforms"/><title type='text'>Software and me</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-2901009688247590449</id><published>2015-03-11T23:53:00.001+00:00</published><updated>2015-03-12T00:04:07.858+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="DataSets"/><category scheme="http://www.blogger.com/atom/ns#" term="Winforms"/><title type='text'>Why does my DataTable merge not work?</title><content type='html'>&lt;p dir=&quot;ltr&quot;&gt;I was recently looking and some older &lt;u&gt;DataTable&lt;/u&gt; code.&lt;br&gt;
We were trying to merge an updated DataRow into an existing DataTable &lt;br&gt;
But... it was having non of it - the changes didn&#39;t go in.&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;After some hunting it turned out that the RowState of both the existing and updated rows was &quot;Modified&quot;.&lt;br&gt;
So the merge didn&#39;t know what to do - what takes precedence?&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;The solution was to call AcceptChanges() on the existing DataTable before merging in the new data.&lt;br&gt;
AccepChanges sets the RowState to &lt;b&gt;Unchanged &lt;/b&gt;and the merge now knows what to do.&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;Job done!&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/2901009688247590449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2015/03/why-does-my-datatable-merge-not-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/2901009688247590449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/2901009688247590449'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2015/03/why-does-my-datatable-merge-not-work.html' title='Why does my DataTable merge not work?'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/06376242778178384993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-3081616434460086509</id><published>2012-07-16T23:43:00.002+01:00</published><updated>2012-07-16T23:43:45.825+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="Ninject"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Asynchronous WCF using the generated service interface</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Using Asynchronous WCF in an IoC style presents an interesting challenge.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Normal examples show that you can call async WCF something like this...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Service1Client iService1 = new Service1Client();&lt;br /&gt;
      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iService1.GetDataCompleted += iService1_GetDataCompleted;&lt;br /&gt;
      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iService1.GetDataAsync();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;i.e. you declare the service client implementation, specify the callback and make the async call.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;But... what if you want to inject the client reference, for example (using Ninject):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[Inject]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;IService1 iService1 {get; set;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;where Service1 is the interface.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Well, you find that the xxxCompleted event and xxxAsync method are not available on the interface. Ouch!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;But, all is not lost...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You do have two other methods...&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;Beginxxxx and Endxxxx and you can use them as in the example below.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif;&quot;&gt;In the Beginxxxx method you specify the callback and in the callback you can get hold of the result by&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif;&quot;&gt;calling Endxxxx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Note &lt;/b&gt;that in the example below, I haven&#39;t injected the Service client, but I am using the interface, IService1. The code produces the following output (with the &quot;Waited&quot; appearing after the calling thread has slept for 5 seconds) :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Making call&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;Got result&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;You entered: 200&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;Waited&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Program&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[]&amp;nbsp;args)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MakeAsynchronousCall(200);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;MakeAsynchronousCall(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IService1&lt;/span&gt;&amp;nbsp;iService1&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Service1Client&lt;/span&gt;();
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;AsyncCallback&lt;/span&gt;&amp;nbsp;aSyncCallBack&amp;nbsp;=
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;delegate&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;IAsyncResult&lt;/span&gt;&amp;nbsp;result)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Got&amp;nbsp;result&quot;&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt;&amp;nbsp;i&amp;nbsp;=&amp;nbsp;iService1.EndGetData(result);
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(i);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;ex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(ex.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Making&amp;nbsp;call&quot;&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iService1.BeginGetData(value,&amp;nbsp;aSyncCallBack,&amp;nbsp;iService1);
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Thread&lt;/span&gt;.Sleep(5000);
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Waited&quot;&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.ReadLine();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;ex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(ex.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The Server-side code is :&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;pre style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;nbsp;GetData(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Format(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;You&amp;nbsp;entered:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: mediumseagreen;&quot;&gt;{0}&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&lt;/span&gt;,&amp;nbsp;value);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/3081616434460086509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2012/07/asynchronous-wcf-using-generated.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3081616434460086509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3081616434460086509'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2012/07/asynchronous-wcf-using-generated.html' title='Asynchronous WCF using the generated service interface'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/06376242778178384993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-1208075369228210083</id><published>2012-02-23T00:13:00.001+00:00</published><updated>2012-02-23T00:13:58.049+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Sync Framework"/><title type='text'>Primary Keys in Entity Framework and Sync Framework - Part 2</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;In &lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=6406442277861689963#editor/target=post;postID=1511400007701934760&quot;&gt;Part 1&lt;/a&gt; we considered various options when it came to using Microsoft Sync Framework with Entity Framework.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;After a certain amount of pain we seem to have got to something approaching a settled condition.&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We didn&#39;t want IDs that were GUIDs as this would make them unreadable. So, we&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;are keeping Primary keys as simple ID columns.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Because of this, we went for a solution that would reseed the local tables on each client to a known range. After each synchronisation, the tables would be reseeded to the correct value. That way entries created on the client/server would have different IDs and wouldn&#39;t clash&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We had to use SQL Server Express on the clients.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Number (3) above is a long story...&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;SQL Compact 4 won&#39;t play nicely with Entity Framework or the Sync Framework (&lt;a href=&quot;http://blogs.msdn.com/b/sqlservercompact/archive/2011/03/15/sql-server-compact-4-0-tooling-support-in-visual-studio-2010-sp1-and-visual-web-developer-express-2010-sp1.aspx#VisualStudioDesignersNotWorkingwithCompa&quot;&gt;Link here&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx&quot;&gt;here&lt;/a&gt; )&lt;/li&gt;
&lt;li&gt;SQL Compact 3.5 wouldn&#39;t play nicely with the various items - follow &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc835494.aspx&quot;&gt;this link&lt;/a&gt; and see the section &quot;Limitations of SQL Server compact&quot; - basically it can&#39;t:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;&quot;&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px; text-align: left;&quot;&gt;support entities with server-generated keys or values when it is used with the Entity Framework&lt;/span&gt;&amp;nbsp;&quot;.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;There&#39;s a lot of other things that SQL server compact can&#39;t do - including supporting stored procedures. So that&#39;s how we ended up back at SQL Server Express.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I hope this gives you a flavour of the sort of things to consider when looking at data replication on SQL Server.&lt;br /&gt;
&lt;br /&gt;
You&#39;re going to ask why didn&#39;t we use SQL Server Merge Replication - that&#39;s another story and another post...&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/1208075369228210083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/primary-keys-in-entity-framework-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/1208075369228210083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/1208075369228210083'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/primary-keys-in-entity-framework-and.html' title='Primary Keys in Entity Framework and Sync Framework - Part 2'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-6091215996557919137</id><published>2012-02-22T23:45:00.000+00:00</published><updated>2012-02-22T23:45:23.402+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Architecture Note</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A short note on architectures for WCF-based solutions - we&#39;ve found this works for us.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;All classes that are being passed across the wire must be serialisable and each property must be annotated.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The WCF service is nothing more than a thin facade on top of a call to Business Logic.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In fact it&#39;s a one-to-one relationship to the Business Logic calls... The Service layer just exposes the business logic so that it can be used in &lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;creating bindings, etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Business Logic - as they say, it &quot;does the business&quot; and calls the data access.layer.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Data Access Layer - we&#39;re using Repository pattern with Entity Framework.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Throughout, we&#39;ve using IoC (Ninject) to hook data access repositories into the Business Layer and Business Logic into the Service Layer. This has meant inserting Ninject into the WCF factory pipeline - see &lt;a href=&quot;http://blog.solutionist-ltd.com/2012/02/using-ninject-in-wcf-services.html&quot;&gt;this post&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;OK, you may ask why create a WCF facade on top of the business logic?&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Well, doing this lets you create clean classes and &quot;unit&quot; tests for the business logic without &amp;nbsp;bothered about annotations, etc for WCF.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;It also means that the Business Logic layer becomes a re-usable component - where you don&#39;t have to include WCF-related annotations and dlls.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/6091215996557919137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/architecture-note.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/6091215996557919137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/6091215996557919137'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/architecture-note.html' title='Architecture Note'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/06376242778178384993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-5468080663911446610</id><published>2012-02-02T00:38:00.000+00:00</published><updated>2012-02-02T00:38:03.176+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>How to get a WPF TextBox to update its ViewModel binding variable</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A short post:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Scenario:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You&#39;re using MVVM and have bound a textbox to a string ViewModel property - in TwoWay mode.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You have a button that is only to be enabled when that string property is not null/empty.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Problem:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You type in the textbox,&amp;nbsp;but the button remains firmly disabled until the textbox loses focus.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Only at that point is the string&#39;s PropertyChanged event raised.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Solution:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(Taken from &amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;http://betaforums.silverlight.net/forums/t/103695.aspx&lt;/span&gt;&amp;nbsp;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Do the following on the TextBox&#39;s TextChanged event:&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;summaryTextBox_TextChanged(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;TextChangedEventArgs&lt;/span&gt;&amp;nbsp;e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;TextBox&lt;/span&gt;&amp;nbsp;txCtl&amp;nbsp;=&amp;nbsp;(&lt;span style=&quot;color: #2b91af;&quot;&gt;TextBox&lt;/span&gt;)sender;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(txCtl&amp;nbsp;!=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt;&amp;nbsp;be&amp;nbsp;=&amp;nbsp;txCtl.GetBindingExpression(&lt;span style=&quot;color: #2b91af;&quot;&gt;TextBox&lt;/span&gt;.TextProperty);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(be&amp;nbsp;!=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;be.UpdateSource();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;       }
&lt;/pre&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This will force the PropertyChanged event to be raised whenever the text is changed - and your button&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;will be enabled as soon as you start typing in the TextBox&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/5468080663911446610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/how-to-get-wpf-textbox-to-update-its.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/5468080663911446610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/5468080663911446610'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/how-to-get-wpf-textbox-to-update-its.html' title='How to get a WPF TextBox to update its ViewModel binding variable'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-3099813057497958382</id><published>2012-02-01T19:24:00.000+00:00</published><updated>2012-02-01T19:25:38.196+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="Ninject"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>More .NET IoC - Using Ninject in WCF Services</title><content type='html'>&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I&#39;ve seen other postings about this, but thought I&#39;d add my own 2p-worth since I had to struggle a bit to get it working.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The basic idea is to use Ninject in the WCF pipeline and get WCF use Ninject to create the service. Then you can take advantage of Ninject&#39;s IoC to manage dependencies.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I used the base Ninject and the Ninject Web and Wcf extensions - all available via NuGet.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;To integrate ninject into the WCF service pipeline, create a &quot;normal&quot; WCF service but add the following to the .svc file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Factory&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Ninject.Extensions.Wcf.NinjectServiceHostFactory&quot;&lt;/span&gt;&amp;nbsp;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So, the file would look something like:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: yellow; background-image: initial; background-origin: initial;&quot;&gt;&amp;lt;%&lt;/span&gt;@&amp;nbsp;ServiceHost&amp;nbsp;Language=&quot;C#&quot;&amp;nbsp;Debug=&quot;true&quot;&amp;nbsp;Service=&quot;WcfService.GeneralService&quot;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CodeBehind=&quot;GeneralService.svc.cs&quot;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Factory=&quot;Ninject.Extensions.Wcf.NinjectServiceHostFactory&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: yellow; background-image: initial; background-origin: initial;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Then you can inject dependencies into the service as needed as follows:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[Inject]
public&amp;nbsp;IUsersRepository&amp;nbsp;_repository&amp;nbsp;{&amp;nbsp;private&amp;nbsp;get;&amp;nbsp;set;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-family: Consolas; font-size: 13px;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-family: Consolas; font-size: 13px;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial, Helvetica, sans-serif; font-size: small; white-space: normal;&quot;&gt;Now we&#39;re assuming that you&#39;re using a WCF application project - so, to initialise Ninject correctly you need to make changes to the WCF project Global.asax file as follows:&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Make Global extend NinjectWcfApplication &amp;nbsp; (from Ninject.Extensions.Wcf)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Implement and override CreateKernel - so the file looks like this:&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp; public&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;Global&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;NinjectWcfApplication&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;    // Other methods omitted for clarity...
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected&amp;nbsp;override&amp;nbsp;Ninject.IKernel&amp;nbsp;CreateKernel()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IKernel&amp;nbsp;k&amp;nbsp;=&amp;nbsp;&amp;nbsp;new&amp;nbsp;StandardKernel(new&amp;nbsp;ServiceModule());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;k;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now the ServiceModule is a Ninject module that would look something like:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;   public&amp;nbsp;class&amp;nbsp;ServiceModule&amp;nbsp;:&amp;nbsp;NinjectModule
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;override&amp;nbsp;void&amp;nbsp;Load()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Bind&lt;iusersrepository&gt;().To&lt;usersrepository&gt;();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/usersrepository&gt;&lt;/iusersrepository&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that we&#39;re binding the IUsersRepository to the UsersRepository implementation.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Doing this will enable Ninject to do its magic in the WCF service above where it is injected.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;When Service is invoked, the Ninject factory will instantiate the class and so be able to use the module bindings to pull in the correct interface implementations.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that you don&#39;t need to change service bindings, etc.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/3099813057497958382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/using-ninject-in-wcf-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3099813057497958382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3099813057497958382'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2012/02/using-ninject-in-wcf-services.html' title='More .NET IoC - Using Ninject in WCF Services'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-1511400007701934760</id><published>2011-12-29T18:42:00.000+00:00</published><updated>2011-12-29T18:43:43.468+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Sync Framework"/><title type='text'>Primary Keys in Entity Framework and Sync Framework</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Hold on - we&#39;re going for a 
walk on the wild side! It will take a few minutes to read - but it&#39;s a 
thriller...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This is a summary of what I&#39;ve discovered after a bit of research - hopefully it will help other developers/architects out.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;      As part of a project I&#39;m looking at creating a SQL server replicated
      architecture... and need to avoid clashes in the PK. The icing on the cake is that we&#39;re using Entity Framework heavily in the project for data access. &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Exhibit 1 &lt;/b&gt;... &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb726011.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/bb726011.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;

    This article gives a few options about choosing a suitable Primary key in replication scenarios:&lt;/span&gt;

    &lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;

    1. Using a GUID&lt;br /&gt;

    2. Pk that includes a node ID&lt;br /&gt;

    3. Natural keys&lt;br /&gt;&lt;br /&gt;

    OK.... starting from the bottom up...&lt;/span&gt;

    &lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;

    &lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Natural Keys won&#39;t work for our project. Full stop&lt;/span&gt;&lt;/span&gt;

    &lt;/li&gt;
&lt;li style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;

    A PK that includes a Node ID - means adding a column and giving each client&amp;nbsp; a Node ID. Not the end of the world, but...

    &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; doesn&#39;t feel right...&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;

    GUID... sounds good, or is it?&lt;/span&gt;

    &lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;

    Enter &lt;/span&gt;

    &lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Exhibit 2&lt;/b&gt; -&lt;a href=&quot;http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/&quot; rel=&quot;bookmark&quot; style=&quot;color: #c73f17; text-decoration: none;&quot; title=&quot;Using a GUID as an EntityKey in Entity
          Framework 4&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/&quot;&gt;http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/&lt;/a&gt;&lt;br /&gt;Yes, it&#39;s all true... I tried it and had to hack the EF model XML to include the correct attribute to get it to work. And,
Yes, doing an update loses the change.&lt;br /&gt;
Yes, it&#39;s a feature and yes, it&#39;s not pleasant - it would mean 
after every update hacking the XML to find all the relevant GUID PKs and
 adding in the 
attribute. I&#39;m sure we could automate it by some clever searching and replacing, but it&#39;s not right.&lt;br /&gt;&lt;br /&gt;
Also, Enter &lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Exhibits 3, 4, 5 and 6&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://www.eggheadcafe.com/tutorials/sql-server/d662b371-ed27-481c-aee0-ebe7cf2d9fad/why-guids-are-not-a-good-idea-for-sql-server-primary-keys.aspx&quot;&gt;http://www.eggheadcafe.com/tutorials/sql-server/d662b371-ed27-481c-aee0-ebe7cf2d9fad/why-guids-are-not-a-good-idea-for-sql-server-primary-keys.aspx&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html&quot;&gt;http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://www.simple-talk.com/sql/database-administration/the-identity-crisis-in-replication/&quot;&gt;http://www.simple-talk.com/sql/database-administration/the-identity-crisis-in-replication/&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://sqlblogcasts.com/blogs/martinbell/archive/2009/05/25/GUID-Fragmentation-in-SQL-Server.aspx&quot;&gt;http://sqlblogcasts.com/blogs/martinbell/archive/2009/05/25/GUID-Fragmentation-in-SQL-Server.aspx&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;
From this set of links you start to see that GUIDs are good, but come with a number of caveats.&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
Also using newsequentialid() - doesn&#39;t necessarily generate sequential 
GUIDs - I tried this. If you do a number of inserts close together then 
you do get them, but not always.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;So, you then can potentially have the performance issues.&lt;br /&gt;
Also, the space issue is relevant for us - since we&#39;re looking to replicate to SQL server compact.&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Alternatives?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First off, &lt;/b&gt;&lt;/span&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;well we could use a normal ID (int) column and change the seed value for each client.&lt;br /&gt;
E.g. The Server has a seed of 10,000000&lt;br /&gt;
Client 1 has a seed of 20, 000000,&lt;br /&gt;
Client 2 has a seed of 30, 000000 etc&lt;br /&gt;&lt;br /&gt;
So, each client would be able to make 9,999,999 inserts before a conflict and we&#39;d have a limit of 214(X2) users because we could have negative 
numbers as well.&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Lets just do some maths....&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The max value of an int is +/-2,147,483647.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;If you&#39;re really worried about conflicts you could go for using a bigint as the ID column, then you could have something like 9223327036850 clients! The seeds could then be something like 100,000000, 
200000000, 300000000, etc so 99,999,999 inserts before a conflict - which should be enough for a 
lifetime - e.g. one insert a second would take you 1157 days. 100 inserts a day would 
take over 2500 years.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; If you were using the the smaller int then 100 inserts a day would 
last over 250 years!&lt;br /&gt;&lt;br /&gt;
That means changing the seed on each client appropriately.&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
Now, there are ways of doing this:&lt;br /&gt;&lt;a href=&quot;http://www.techrepublic.com/blog/datacenter/how-do-i-reseed-a-sql-server-identity-column/406&quot;&gt;http://www.techrepublic.com/blog/datacenter/how-do-i-reseed-a-sql-server-identity-column/406&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; but it seems there a some gotchas that you have to be aware of:&lt;br /&gt;&lt;a href=&quot;http://geekswithblogs.net/argot/archive/2009/10/18/sync-framework-common-practise-of-ado.net.aspx&quot;&gt;http://geekswithblogs.net/argot/archive/2009/10/18/sync-framework-common-practise-of-ado.net.aspx&lt;/a&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;
Basically, you have to store and remember seed values before/after synchronisation. &lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
You&#39;d keep a list of seed values for each client. So any time you get a&amp;nbsp;
 new client the first sync would also download its seed value.&lt;br /&gt;&lt;br /&gt;
This solution has a certain appeal, because:&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
a. it leaves the PK alone as a single ID column&lt;br /&gt;
b. The replication mechanism takes care of the seeding/reseeding.&lt;br /&gt;
c. Entity Framework designer won&#39;t throw any wobblies.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Next alternative...&amp;nbsp;&lt;/b&gt;&lt;/span&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Go back to a compound PK, ID plus a Node ID.&lt;br /&gt;
a. Entity Framework should cope with this.&lt;br /&gt;
b. Replication mechanism should be a bit simpler.&lt;br /&gt;
But... it means infecting the database with the replication details i.e.
 the Node ID and artificially creating a more complex PK. So, you can&#39;t just go &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;select * from Users where ID = 10&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Another thought....&lt;/b&gt;&lt;/span&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;This is horrible I think, but has a certain &quot;something&quot; about it!&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;
Leave the PKs alone completely - simple ID column with an int.&lt;br /&gt;
Then code for the PK conflicts in the sync framework - as it will detect PK 
conflicts.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;So, we write logic that will do something like:&lt;br /&gt;
- determine of the inserted record exists on the server&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;- if not, then 
add it (generating a new record/PK) then remove it from the client and &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;
- resync the client to pull down the &quot;new&quot; record but with the updated PK.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
You&#39;d have to write this sort of thing to cover various scenarios and it
 may/would be table-specific - but what if we replicating a lot of tables? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Summing up...&lt;/b&gt;&lt;/span&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;We&#39;re looking at&amp;nbsp; either the compound PK or the different seed values.&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;We&#39;re going to try some stuff out - probably the different seed values first as that leaves the EF model alone completely - and I&#39;ll try and report back how it went. &lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/1511400007701934760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2011/12/primary-keys-in-entity-framework-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/1511400007701934760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/1511400007701934760'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2011/12/primary-keys-in-entity-framework-and.html' title='Primary Keys in Entity Framework and Sync Framework'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-580028624835089867</id><published>2011-09-08T15:38:00.000+01:00</published><updated>2011-09-08T15:43:44.514+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework"/><title type='text'>Entity Framework Tip #1 - Using MergeOption to get latest entities</title><content type='html'>&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Hopefully this is the first of various Entity Framework tips that I&#39;ve gleaned along the way.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;They&#39;ll serve as reminders for me and if they can help other people, they will have served their purpose.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Ok, what&#39;s wrong with this?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;(We&#39;re using STEs because we&#39;re throwing things across the network).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;I was doing some testing and had code that looked like this.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: none repeat scroll 0% 0% white; color: black; font-family: Consolas;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; DBEntities&amp;nbsp;context1&amp;nbsp;=&amp;nbsp;new DBEntities();
 
&amp;nbsp;DBEntities&amp;nbsp;context2&amp;nbsp;=&amp;nbsp;new DBEntities();
&amp;nbsp;Site&amp;nbsp;newSite&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Site();
 newSite.SiteName&amp;nbsp;=&amp;nbsp;&quot;QAZ&quot;;
 
&amp;nbsp;context1.Sites.AddObject(newSite);
 context1.ApplyChanges(&quot;Sites&quot;,&amp;nbsp;newSite);
 context1.SaveChanges();
 
&amp;nbsp;Site&amp;nbsp;site2&amp;nbsp;=&amp;nbsp;context2.Sites.Where(s&amp;nbsp;=&amp;gt;&amp;nbsp;s.ID&amp;nbsp;==&amp;nbsp;newSite.ID).FirstOrDefault();
 
&amp;nbsp;//&amp;nbsp;update&amp;nbsp;the&amp;nbsp;site...
&amp;nbsp;site2.ChangeTracker.ChangeTrackingEnabled&amp;nbsp;=&amp;nbsp;true; // Because they&#39;re STEs
&amp;nbsp;site2.SiteName&amp;nbsp;=&amp;nbsp;&quot;QAZ&amp;nbsp;QAZ&quot;;
 context2.ApplyChanges(&quot;Sites&quot;,&amp;nbsp;site2);
 context2.SaveChanges();
 
 
 // I thought I&#39;d use the first&amp;nbsp;context&amp;nbsp;to&amp;nbsp;query&amp;nbsp;for the updated site...
&amp;nbsp;
&amp;nbsp;var query =&amp;nbsp;context1.Sites.Where(s&amp;nbsp;=&amp;gt;&amp;nbsp;s.ID&amp;nbsp;==&amp;nbsp;newSite.ID);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background: none repeat scroll 0% 0% white; color: black; font-family: Consolas;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; Site&amp;nbsp;site3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; = query.FirstOrDefault();&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;What&#39;s the SiteName of site3?&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
No, it&#39;s not &quot;QAZ QAZ&quot; - it&#39;s &quot;QAZ&quot;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;i&gt;Why is that?&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
Because the site already exists in context1 - so even though a database query is actually executed, EF will not overwrite what&#39;s in context1 because its cache already contains an entity with that EntityKey.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;i&gt;How to make sure that I actually get the latest values back?&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
Set the MergeOption on the objectSet before doing the call - as follows... &lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background: none repeat scroll 0% 0% white; color: black; font-family: Consolas;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;context1.Sites.MergeOption&amp;nbsp;=&amp;nbsp;MergeOption.OverwriteChanges;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
The default option is AppendOnly which won&#39;t update the context if it finds an entity with the&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
same entityKey present.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
Another tip from the twighlight world of entity framework...&lt;br /&gt;
&lt;br /&gt;
One thing I&#39;ve yet to investigate is how delayed execution would affect MergOption settings.&lt;br /&gt;
So, if I reset the MergeOption after the query to AppendOnly and then do further queries before finally executing the query - would the different MergeOptions be applied at the right time... hmmm...&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&amp;nbsp; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/580028624835089867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2011/09/entity-framework-tip-1-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/580028624835089867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/580028624835089867'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2011/09/entity-framework-tip-1-using.html' title='Entity Framework Tip #1 - Using MergeOption to get latest entities'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-3256176215857595523</id><published>2011-06-07T13:03:00.001+01:00</published><updated>2011-06-07T13:04:13.276+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring.NET"/><title type='text'>.NET IoC - part 3 (Spring)</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;It&#39;s been some time, but this is continuing my previous &lt;a href=&quot;http://blog.josephbabad.co.uk/2011/01/net-ioc-part-2-structuremap.html&quot;&gt;posts &lt;/a&gt;about .NET IoC.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;As I&#39;m familiar with Spring from the Java world, I thought I&#39;d transfer that knowledge across to .NET. It turned out to be less painful than I expected.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;I was building a service-based project and used spring on both the client and server sides of the divide. For this post, I&#39;ll initially stick to it&#39;s use on the client side, but server-side has a very similar set-up. Maybe I&#39;ll come to full WCF integration later on.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;For basic IoC you just need the Spring.Core.dll from the distribution - add this as a reference to your project.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Initially I&#39;m following the KISS principle, so I created a basic application context file - spring.config.xml and put that at the top level of my project.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Basic format is as follows:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;objects xmlns=&quot;http://www.springframework.net&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;object id=&quot;Object1&quot;&lt;br /&gt;
type=&quot;&amp;lt;Assembly name&amp;gt;.namespace.classname1, &amp;lt;assembly name&amp;gt;&quot; singleton=&quot;false&quot;&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre style=&quot;background: white; color: black; font-family: Consolas; font-size: 13;&quot;&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;property&amp;nbsp;name=&quot;Property1&quot;&amp;nbsp;&amp;nbsp;ref=&quot;Object2&quot;&amp;nbsp;/&lt;/span&gt;&lt;code&gt;&amp;gt;&lt;/code&gt;
&lt;/pre&gt;&lt;code&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt;object id=&quot;Object2&quot;&lt;br /&gt;
type=&quot;&amp;lt;Assembly name&amp;gt;.namespace.classname2, &amp;lt;assembly name&amp;gt;&quot; singleton=&quot;false&quot;&amp;gt;&lt;/code&gt; &lt;br /&gt;
&lt;code&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;  &amp;lt;/objects&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;The &lt;code&gt;singleton=&quot;false&quot;&lt;/code&gt; will ensure that Spring gives you a new instance every time you request the particular object.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;As a minimum in your code, you&#39;ll need to create an application context somewhere.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;I&#39;ve put it in a singleton Locator class as follows:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
private static IApplicationContext _context = null;&lt;br /&gt;
_context = new XmlApplicationContext(&quot;spring-config.xml&quot;);&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;where spring-config.xml is the name of your config file. This is sitting at the top-level of the project.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Then you&#39;ll want a method to grab hold of an object instance as follows:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
public object getObjectInstance(string name)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;return _context.GetObject(name);&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;or, if you need to pass arguments in to the constructor...&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
public object getObjectInstance(string name, object[] args)&lt;br /&gt;
{            &lt;br /&gt;
&amp;nbsp;&amp;nbsp;return _context.GetObject(name, args);&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;In both cases &quot;name&quot; is the object&#39;s ID in the configuration file.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Passing arguments in like this is &quot;OK&quot;, but can be a pain, since there&#39;s no compile time checking - but we&#39;re staying simple.&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;At some point you could call:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
Locator.Instance.getObjectInstance(&quot;Object1&quot;);&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;This will:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;create an instance of Object1&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;create an instance of Object2&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;set Property1 on Object1 to be Object2&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;return you a &quot;ready-to-go&quot; instance of Object1.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;These are your absolute basics. But hopefully this will put you on the road.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/3256176215857595523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2011/06/net-ioc-part-3-spring.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3256176215857595523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3256176215857595523'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2011/06/net-ioc-part-3-spring.html' title='.NET IoC - part 3 (Spring)'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-3362986922903886862</id><published>2011-01-12T23:32:00.002+00:00</published><updated>2011-02-15T14:21:14.751+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="StructureMap"/><category scheme="http://www.blogger.com/atom/ns#" term="Unity"/><title type='text'>.Net IoC - part 2 (StructureMap)</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;It&#39;s been&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; some time since I&#39;ve last posted anything up, but I thought I&#39;d put up a bit more about my&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;working with IoC in .NET.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In a &lt;a href=&quot;http://blog.josephbabad.co.uk/2010/08/net-ioc.html&quot;&gt;previous post &lt;/a&gt;I mentioned that I&#39;d come across Spring.NET, Unity&lt;/span&gt; and StructureMap&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;I wanted something that I could pick up easily and which focused on IoC.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Starting to using it fairly simple.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;You reference the structuremap dll&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add something looking like this into your code... I wrapped it up in a Singleton to give me more flexibility..&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;public&amp;nbsp;sealed&amp;nbsp;class&amp;nbsp;Locator&lt;/span&gt; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;static&amp;nbsp;volatile&amp;nbsp;Locator&amp;nbsp;_instance&amp;nbsp;=&amp;nbsp;null;&lt;/span&gt; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;static&amp;nbsp;object&amp;nbsp;syncRoot&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Object();&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-family: consolas;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;static&amp;nbsp;Container&amp;nbsp;objectFactory&amp;nbsp;=&amp;nbsp;null; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;Locator()&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objectFactory&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Container(&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&amp;nbsp;=&amp;gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;

&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x.For&amp;lt;myservice&gt;().Use&amp;lt;myserviceclient&gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/myserviceclient&gt;&amp;lt;/myservice&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.For&amp;lt;ihelper&gt;().Use&amp;lt;realhelper&gt;();&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: consolas;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt; 
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x.For&amp;lt;iinterface1&gt;().Use&amp;lt;implementation1&gt;()&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Setter&lt;myservice&gt;().IsTheDefault();&lt;/myservice&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;static&amp;nbsp;Locator&amp;nbsp;Instance&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(_instance&amp;nbsp;==&amp;nbsp;null)&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lock&amp;nbsp;(syncRoot)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(_instance&amp;nbsp;==&amp;nbsp;null)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_instance&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Locator();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;_instance;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;object&amp;nbsp;getObjectInstance&lt;t&gt;()&lt;/t&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;objectFactory.GetInstance&lt;t&gt;();&lt;/t&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;object&amp;nbsp;getObjectInstance&lt;t&gt;(Dictionary&lt;string,&amp;nbsp;object&gt;&amp;nbsp;items)&lt;/string,&amp;nbsp;object&gt;&lt;/t&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;args&amp;nbsp;=&amp;nbsp;new&amp;nbsp;ExplicitArguments();&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;(var&amp;nbsp;item&amp;nbsp;in&amp;nbsp;items)&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//args.Set(item);&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;args.SetArg(item.Key,&amp;nbsp;item.Value);&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;objectFactory.GetInstance&lt;t&gt;(args);&lt;/t&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: consolas;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;In code I&#39;m calling:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Locator.Instance.getObjectInstance&lt;type&gt;()&lt;/type&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The second method allow you to pass in constructor parameters.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;All this means I can remove references to StructureMap from my Code and, if need be,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;swap out IoC containters without affecting the rest of the code. In fact, this happened eventually.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;StructureMap looked a good candidate, the fluent  interface is nice and there&#39;s no XML if you don&#39;t want it! But, I did  find the that the lack of decent documentation was an issue.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;There was a lot of information - but scattered around. I didn&#39;t want to spent ages hunting stuff down.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Unity, I&#39;m afraid, seemed over complicated.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; I&#39;m still getting my head round other .Net stuff and I wanted to minimise the amount to learn.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;That left Spring.... which, all being well, I&#39;ll cover in part 3.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/3362986922903886862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2011/01/net-ioc-part-2-structuremap.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3362986922903886862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3362986922903886862'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2011/01/net-ioc-part-2-structuremap.html' title='.Net IoC - part 2 (StructureMap)'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-3247936872170473876</id><published>2010-09-20T17:48:00.000+01:00</published><updated>2010-09-20T17:48:54.895+01:00</updated><title type='text'>Early Entity Framework thoughts</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;It&#39;s been a few weeks since my last post, but I&#39;ve been reading and working with a couple of good books.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;One of those was O&#39;Reilly&#39;s Programming Entity Framework (ISBN&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;9780596807276).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;It&#39;s not an easy read, but, then again, it&#39;s not really meant to be. The topic is huge with ramifications &amp;nbsp;across any multi-tier application.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I&#39;m currently looking at an N-tier app with a combination of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;WPF, Silverlight and ASP.NET presentation layers, so having the underlying technology and architecture right is critical.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;With that in mind, the sections on WCF RIA and Data services are very helpful and the worked examples are excellent to go through.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now, behind all this is a niggle along the lines of &quot;I&#39;ve seen this before&quot;... where?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Well, Hibernate&#39;s been around Java world some time (Nhibernate more recently for MS) and, before that, you have J2EE&#39;s early awkward/abortive (choose your adjective) attempts at ORM using EJB 1 and 2.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;EJB3 and Hibernate now provide a data access layer with Spring&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;or EJB3&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;session beans sitting above that providing declarative transaction management and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;access control.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We had Data Transfer Objects (DTOs) for passing data across layers.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Moving across to .NET4 we have the DTO equivalent - i.e. POCOs or STEs or RIA Services&#39; own cross-tier mechanism. You also have EF4 providing the ORM and data access, then WCF in it&#39;s various forms provides the service/session layer.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;So, for N-tier apps, I get a feeling of it being a case of &quot;Hello Microsoft, welcome to my world!&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;It&#39;s early days and I&#39;ll see how this all goes in MS-land. Having done some prototyping, I have to say is that the MS tooling goes a good way to smoothing out a lot of bumps in the road.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I&#39;m still waiting for Netbeans/Eclipse/MyEclipse to get to the level of Visual Studio tooling - especially when developing UIs.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;See you back here soon.&lt;/span&gt;&lt;br /&gt;
&lt;h6 class=&quot;western&quot;&gt;&amp;nbsp;&lt;/h6&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/3247936872170473876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2010/09/early-entity-framework-thoughts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3247936872170473876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/3247936872170473876'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2010/09/early-entity-framework-thoughts.html' title='Early Entity Framework thoughts'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-6656731163890192256</id><published>2010-08-10T18:56:00.001+01:00</published><updated>2010-08-10T19:48:07.926+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Quartz"/><title type='text'>Quartz.NET</title><content type='html'>&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;I haven&#39;t got round to trying Spring.NET yet, but had a play with another Java-to-.NET port: Quartz.NET.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;I&#39;m sure that there are other posts/tutorials about how to get it working, but I&#39;ll add in my twopennyworth as a step-by-step account of what I did.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;1. Downloaded latest version of Quartz.NET - 1.0.2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;2. Using VS2010, I created a Web Project and added references to the Quartz and Common.Logging dll&#39;s that are in the bin directory&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;3. For good measure I also added a reference to the log4net dll - I would be using this in the Quartz job.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;4. For log4net config, I kept this separate from the application and placed a log4net.config file in project. I then referenced this in Global.asax as follows:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; log4net.Config.DOMConfigurator.ConfigureAndWatch(new System.IO.FileInfo(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + &quot;log4net.config&quot;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;My log4net config file looked like:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;
&amp;lt;log4net&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;lt;root&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;level value=&quot;DEBUG&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;appender-ref ref=&quot;RollingFileAppender&quot;/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/root&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;lt;appender name=&quot;RollingFileAppender&quot; type=&quot;log4net.Appender.RollingFileAppender&quot;&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;file value=&quot;logs\Logfile.log&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;appendToFile value=&quot;true&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;lockingModel type=&quot;log4net.Appender.FileAppender+MinimalLock&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;rollingStyle value=&quot;Composite&quot;/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;datePattern value=&quot;yyyyMMdd&quot;/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;maxSizeRollBackups value=&quot;10&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;maximumFileSize value=&quot;1000KB&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;staticLogFileName value=&quot;true&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;conversionPattern value=&quot;%d [%t]%-5p %c [%x] - %m%n&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/layout&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/appender&amp;gt;

&amp;lt;/log4net&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;5. Ran the database script (for SQL server) to create the relevant tables.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;6. Updated the Web. Config file as follows:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;div style=&quot;font-size: small;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt; &amp;nbsp;&amp;lt;configSections&amp;gt;

&lt;div style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;section name=&quot;quartz&quot; type=&quot;System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&amp;gt;&lt;/div&gt;&lt;div style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/configSections&amp;gt;&lt;/div&gt;&lt;/code&gt;
&lt;div style=&quot;font-size: small;&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt; &amp;nbsp;&amp;lt;quartz&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.scheduler.instanceName&quot; value=&quot;CommerceScheduler&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;!-- Configure Thread Pool --&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.threadPool.type&quot; value=&quot;Quartz.Simpl.SimpleThreadPool, Quartz&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.threadPool.threadCount&quot; value=&quot;10&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.threadPool.threadPriority&quot; value=&quot;Normal&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;!-- Configure Job Store --&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.misfireThreshold&quot; value=&quot;60000&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;!--&amp;lt;add key=&quot;quartz.jobStore.type&quot; value=&quot;Quartz.Simpl.RAMJobStore, Quartz&quot; /&amp;gt;--&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.type&quot; value=&quot;Quartz.Impl.AdoJobStore.JobStoreTX, Quartz&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.dataSource&quot; value=&quot;default&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.tablePrefix&quot; value=&quot;QRTZ_&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.clustered&quot; value=&quot;true&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.lockHandler.type&quot; value=&quot;Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.driverDelegateType&quot; value=&quot;Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.dataSource.default.connectionString&quot; value=&quot;Data Source=Server_Name;Initial Catalog=quartz;Integrated Security=True&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.dataSource.default.provider&quot; value=&quot;SqlServer-20&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;add key=&quot;quartz.jobStore.useProperties&quot; value=&quot;true&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/quartz&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;div&gt;7. Created a test job:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public class QuartzJob1 : IJob&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;protected static log4net.ILog log = &amp;nbsp; &amp;nbsp; &amp;nbsp;log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;void IJob.Execute(JobExecutionContext context)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;log.Debug(&quot;QuartzJob1 run&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;8. For testing purposes created a class with the following static method.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public static void InitQuartz()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// construct a scheduler factory&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ISchedulerFactory schedFact = new StdSchedulerFactory();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// get a scheduler&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;IScheduler sched = schedFact.GetScheduler();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sched.Start();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// construct job info&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;JobDetail jobDetail = new JobDetail(&quot;myJob&quot;, null, typeof(QuartzJob1));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// fire every hour&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Trigger trigger = TriggerUtils.MakeMinutelyTrigger();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// start on the next even hour&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;trigger.StartTimeUtc = TriggerUtils.GetNextGivenMinuteDate(DateTime.UtcNow, 1);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;trigger.Name = &quot;myTrigger&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sched.ScheduleJob(jobDetail, trigger);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;9. Global.asax added a call to InitQuartz()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;10. Ran the application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;You should see a log message being written out every minute.&lt;/div&gt;&lt;div&gt;And you should see entries in the &lt;/div&gt;&lt;div&gt;QRTZ_SIMPLE_TRIGGERS and QRTZ_FIRED_TRIGGERS tables.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/6656731163890192256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/quartznet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/6656731163890192256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/6656731163890192256'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/quartznet.html' title='Quartz.NET'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-2572704957979265131</id><published>2010-08-06T14:30:00.006+01:00</published><updated>2010-08-06T14:44:36.920+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq"/><category scheme="http://www.blogger.com/atom/ns#" term="RIA Services"/><title type='text'>RIA Services and ASP.NET</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;I&#39;ve been looking at WCF RIA services for a new project - and looking at seeing if I can use the DomainService on an ASP.NET page directly. &lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;This gets you to a half-way house situation &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:arial;&quot;&gt;where you have your middle-tier, but don&#39;t have to learn Silverlight just yet. It&#39;s not immediately obvious where to start, but you need to get hold of the RIA services toolkit (for SL4... I&#39;m working with VS2010) - which then gives you a DomainDataSource available for use on .aspx pages.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;So.... created my DomainService with a couple of related entities.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;pulled in a couple of DomainDataSources for the master and detail queries and hooked up &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:arial;&quot;&gt;a grid for the master query and DetailView for the detail.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;The basic concept worked fine!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;But.. then I tried to enable paging and sorting in the master and detail view and got this error&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;h4&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h4&gt;&lt;blockquote&gt;&lt;h4&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;The method ‘Skip’ is only supported for sorted input in LINQ to Entities.  The method ‘OrderBy’ must be called before the method  ‘Skip’.&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h4&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Description: &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;An unhandled exception occurred during the  execution of the current web request. Please review the stack trace for more  information about the error and where it originated in the code.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Exception Details: &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;System.NotSupportedException: The method ‘Skip’ is  only supported for sorted input in LINQ to Entities. The method ‘OrderBy’ must  be called before the method ‘Skip’. &lt;/span&gt;&lt;/blockquote&gt;Hmmm....&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;It turns out (thanks to this &lt;a href=&quot;http://msdnrss.thecoderblogs.com/2010/05/22/using-domain-service-with-aspnet-dynamic-data/&quot;&gt;link&lt;/a&gt;) that you need to add some default ordering to your query methods in the DomainService. This enforces the ordering before any other modifier.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/2572704957979265131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/ria-services-and-aspnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/2572704957979265131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/2572704957979265131'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/ria-services-and-aspnet.html' title='RIA Services and ASP.NET'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-8962865518017796308</id><published>2010-08-04T22:52:00.000+01:00</published><updated>2010-08-04T23:07:07.770+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Career"/><category scheme="http://www.blogger.com/atom/ns#" term="Training"/><title type='text'>Training</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Running an ASP.NET training course recently got me thinking about the range of skills someone needs nowadays working in IT. &lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;The students came from a wide range of backgrounds - some with more or less development experience, but the range of topics we were covering on was huge:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;HTML&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Javascript&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;C#&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;OO concepts&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;XML&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Security&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Database access&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Visual Studio IDE (a course in itself!)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;... and we&#39;re not even talking about particularly complex sites.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;If you are talking about complex enterprise applications, then you&#39;re into services (of varying kinds), AJAX, async messaging, enterprise integration, design patterns, various competing Microsoft and Java/J2EE technologies, etc, etc&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;I&#39;ve picked this up over many years in the industry - these students are faced with a bewildering array of information to absorb at the outset. Unfortunately, all too often, potential employers want to see the &quot;finished&quot; article - but it doesn&#39;t happen overnight.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;I wish them well on their chosen career path - if they appreciate that being in IT means being willing to look at new ideas and continue learning, then they&#39;re a good part of the way there to appreciating what IT is as a profession.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/8962865518017796308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/training.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/8962865518017796308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/8962865518017796308'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/training.html' title='Training'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6406442277861689963.post-77096485703558253</id><published>2010-08-04T22:31:00.000+01:00</published><updated>2010-08-04T22:38:41.111+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Unity"/><title type='text'>.NET IoC</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Blogging is a new departure for me, but now I&#39;ve started my own company (&lt;a href=&quot;http://www.solutionist-ltd.com&quot;&gt;Solutionist&lt;/a&gt;) - it seemed like a good &lt;/span&gt;time to start... so here goes...&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;I&#39;ve been working a lot with .NET technologies lately and have been trying to pull across my&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;existing Java/J2EE knowledge as a frame of reference. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Something that was sorely missing was Dependency Injection - I&#39;d become fairly hooked on Spring for that and was really missing it in Microsoft World. So, finding Spring.NET and Microsoft&#39;s own Unity framework has come as a bit of a relief. Now it&#39;s just a case of seeing which one &quot;fits&quot; better.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;Hopefully, over the next few days as I try them both out, I&#39;ll write it up.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.solutionist-ltd.com/feeds/77096485703558253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/net-ioc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/77096485703558253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6406442277861689963/posts/default/77096485703558253'/><link rel='alternate' type='text/html' href='http://blog.solutionist-ltd.com/2010/08/net-ioc.html' title='.NET IoC'/><author><name>Joseph</name><uri>http://www.blogger.com/profile/15654104388244768914</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>