<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>
			Comments at DigitallyCreated Blog (for blogs tagged: &quot;C#&quot;)
		</title>
		<link>http://www.digitallycreated.net/Blog/Tags/C%23/CommentRss</link>
		<atom:link href="http://www.digitallycreated.net/Blog/Tags/C%23/CommentRss" rel="self" type="application/rss+xml" />
		<description>
			A feed of all comments that are posted on any blog at DigitallyCreated that is tagged with &quot;C#&quot;.
		</description>
		<lastBuildDate>Sun, 05 Feb 2012 13:09:47 GMT</lastBuildDate>
		
		
			<item>
				<title>Unknown (myopenid) commented on &quot;Entity Framework, TransactionScope and MSDTC&quot;</title>
				<link>http://www.digitallycreated.net/Blog/48/entity-framework-transactionscope-and-msdtc#Comment62</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 62</guid>
				<dc:creator>Unknown (myopenid)</dc:creator>
				<pubDate>Tue, 24 Jan 2012 15:07:44 GMT</pubDate>
				<description>
					Hi, I am writing a serial transaction and had some troubles.&lt;br/&gt;If I only execute one thread, it executes fast, no waiting.&lt;br/&gt;If I execute two or more threads, the first thread that complete takes too much time but subsequent threads are fast, why?&lt;br/&gt;&lt;br/&gt;If I run two process concurrently of this program, each process's first thread takes too much time to complete but subsequent are fast, is this normal?&lt;br/&gt;&lt;br/&gt;I am using sql express 2008&lt;br/&gt;&lt;br/&gt;tanks.&lt;br/&gt;&lt;br/&gt;class Program&lt;br/&gt;    {&lt;br/&gt;        int numero;&lt;br/&gt;&lt;br/&gt;        Program(int numero)&lt;br/&gt;        {&lt;br/&gt;            this.numero = numero;&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        static void Main(string[] args)&lt;br/&gt;        {&lt;br/&gt;            Console.WriteLine(&amp;quot;Puede presionar una tecla para salir en cualquier momento&amp;quot;);&lt;br/&gt;&lt;br/&gt;            for (int i = 0; i &amp;lt; 10; i++)&lt;br/&gt;            {&lt;br/&gt;                Program p = new Program(i + 1);&lt;br/&gt;                Thread t = new Thread(p.Ejecutar);&lt;br/&gt;                t.Start();&lt;br/&gt;            }&lt;br/&gt;&lt;br/&gt;            Console.ReadKey();&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        public void Ejecutar()&lt;br/&gt;        {  &lt;br/&gt;            bool esPosibleProseguir = true;&lt;br/&gt;            while (esPosibleProseguir)&lt;br/&gt;            {&lt;br/&gt;                Database1Entities cx = new Database1Entities();&lt;br/&gt;                TransactionOptions opts = new TransactionOptions();&lt;br/&gt;                opts.IsolationLevel = System.Transactions.IsolationLevel.Serializable;&lt;br/&gt;                System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope(TransactionScopeOption.Required, opts);&lt;br/&gt;&lt;br/&gt;                try&lt;br/&gt;                {&lt;br/&gt;                    //var mayor = cx.Numeracion.First();&lt;br/&gt;                    //int nuevo = mayor.Numero + 1;&lt;br/&gt;                    cx.Connection.Open();&lt;br/&gt;&lt;br/&gt;                    int nuevo = cx.VistaNumero.First().Actual;&lt;br/&gt;&lt;br/&gt;                    var per = new Persona();&lt;br/&gt;                    per.Nombre = string.Format(&amp;quot;Persona-{0}&amp;quot;, nuevo);&lt;br/&gt;                    per.Ci = (1000 + nuevo).ToString();&lt;br/&gt;                    per.Numero = nuevo;&lt;br/&gt;                    cx.Persona.AddObject(per);&lt;br/&gt;&lt;br/&gt;                    /&lt;a href=&quot;/mayor.&quot;&gt;/mayor.&lt;/a&gt;Numero = nuevo;&lt;br/&gt;&lt;br/&gt;                    cx.SaveChanges();&lt;br/&gt;                    scope.Complete();&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;                    Console.WriteLine(&amp;quot;Hilo: {0}, Crea persona: {1}&amp;quot;, this.numero, nuevo);&lt;br/&gt;                    break;&lt;br/&gt;                }&lt;br/&gt;                catch (UpdateException ex1)&lt;br/&gt;                {&lt;br/&gt;                    esPosibleProseguir = true;&lt;br/&gt;                }&lt;br/&gt;                catch (TransactionAbortedException ex2)&lt;br/&gt;                {&lt;br/&gt;                    esPosibleProseguir = true;&lt;br/&gt;                }&lt;br/&gt;                catch (Exception ex)&lt;br/&gt;                {&lt;br/&gt;                    Console.WriteLine(&amp;quot;Hilo: {0}, Excepci&amp;#243;n: {1}, Mensaje: {2}&amp;quot;, this.numero, ex.GetType().Name, ex.Message);&lt;br/&gt;                    esPosibleProseguir = false;&lt;br/&gt;                }&lt;br/&gt;                finally&lt;br/&gt;                {&lt;br/&gt;                    DisponerObjeto(scope);&lt;br/&gt;                    DisponerObjeto(cx);&lt;br/&gt;                }&lt;br/&gt;            }&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        private void DisponerObjeto(IDisposable obj)&lt;br/&gt;        {&lt;br/&gt;            try&lt;br/&gt;            {&lt;br/&gt;                obj.Dispose();&lt;br/&gt;            }&lt;br/&gt;            catch (Exception ex)&lt;br/&gt;            {&lt;br/&gt;                Console.WriteLine(&amp;quot;Hilo: {0}, Excepci&amp;#243;n: {1}, Mensaje: {2}&amp;quot;, this.numero, ex.GetType().Name, ex.Message);&lt;br/&gt;            }&lt;br/&gt;        }&lt;br/&gt;    }
				</description>
			</item>
		
		
			<item>
				<title>Adalton commented on &quot;More Dynamic Queries using Expression Trees&quot;</title>
				<link>http://www.digitallycreated.net/Blog/62/more-dynamic-queries-using-expression-trees#Comment57</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 57</guid>
				<dc:creator>Adalton</dc:creator>
				<pubDate>Thu, 08 Sep 2011 17:46:49 GMT</pubDate>
				<description>
					This example is fantastic. Congratulations!!!&lt;br/&gt;&lt;br/&gt;I have a doubt. In this example, you put only Equal condition.&lt;br/&gt;&lt;br/&gt;In my scenario, I'd like put the LIKE Command. For example, tag.Name Like &amp;quot;abc&amp;quot;.&lt;br/&gt;&lt;br/&gt;Again, congratulations!!!
				</description>
			</item>
		
		
			<item>
				<title>Mack commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment56</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 56</guid>
				<dc:creator>Mack</dc:creator>
				<pubDate>Thu, 08 Sep 2011 12:11:40 GMT</pubDate>
				<description>
					Note that this won't work if you have any mixed mode assemblies.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;https://connect.microsoft.com/VisualStudio/feedback/details/97801/loading-mixed-assembly-with-assembly-load-byte-throw-exception-changed-behaviour&quot;&gt;https://connect.microsoft.com/VisualStudio/feedback/details/97801/loading-mixed-assembly-with-assembly-load-byte-throw-exception-changed-behaviour&lt;/a&gt;
				</description>
			</item>
		
		
			<item>
				<title>Stefan commented on &quot;Removing a Windows System Certificate Store&quot;</title>
				<link>http://www.digitallycreated.net/Blog/58/removing-a-windows-system-certificate-store#Comment55</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 55</guid>
				<dc:creator>Stefan</dc:creator>
				<pubDate>Tue, 30 Aug 2011 06:29:17 GMT</pubDate>
				<description>
					I'm sorry to say, but I'm definitely tired :-(&lt;br/&gt;&lt;br/&gt;I had to run my little utility at an elevated administrative level in order to delete certificate stores from local machine. &lt;br/&gt;&lt;br/&gt;Arghhh... I should have been aware of this (not the first time it happens).&lt;br/&gt;&lt;br/&gt;Thanks for this wonderful blog and useful information.&lt;br/&gt;
				</description>
			</item>
		
		
			<item>
				<title>Stefan commented on &quot;Removing a Windows System Certificate Store&quot;</title>
				<link>http://www.digitallycreated.net/Blog/58/removing-a-windows-system-certificate-store#Comment54</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 54</guid>
				<dc:creator>Stefan</dc:creator>
				<pubDate>Tue, 30 Aug 2011 06:09:46 GMT</pubDate>
				<description>
					Thank you for pointing some of us in the right direction. &lt;br/&gt;&lt;br/&gt;I have a question: Have you ever tried to remove/delete a certificate store from the local machine instead of current user? &lt;br/&gt;&lt;br/&gt;I managed to delete certificate stores from the current user but never from the local machine. Curiously enough, the CertUnregisterSystemStore() call with (CERT_STORE_DELETE_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE) ends up successfully every single time but without any effect!&lt;br/&gt;&lt;br/&gt;Michel I. Gallant (&lt;a href=&quot;http://www.jensign.com/JavaScience/www/deletesystemstore/index.html&quot;&gt;http://www.jensign.com/JavaScience/www/deletesystemstore/index.html&lt;/a&gt;) has a Java implementation where he seems to suggest that &amp;quot;Only deletion of CERT_SYSTEM_STORE_CURRENT_USER stores is enabled&amp;quot;. I wonder if he refers to Windows or to his own program. MSDN does not state anything clearly in this matter.&lt;br/&gt;&lt;br/&gt;Any comments are welcome. 
				</description>
			</item>
		
		
			<item>
				<title>greenaj commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment53</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 53</guid>
				<dc:creator>greenaj</dc:creator>
				<pubDate>Mon, 22 Aug 2011 21:25:15 GMT</pubDate>
				<description>
					I have been using this successfully on 32 bit Win 7 and Win XP Pro.  On 64 bit Win 7, this fails for release builds.  However, if you decorate you Program.Main with [MethodImpl(MethodImplOptions.NoOptimization)] it magically works.  You can also create a static constructor for your Program class and add the AssemblyResolve event handler there without having to use MethodImpl attribute.  &lt;br/&gt;&lt;br/&gt;This is curious.&lt;br/&gt;&lt;br/&gt;aris&lt;br/&gt;blog &lt;a href=&quot;http://www.level533.com&quot;&gt;http://www.level533.com&lt;/a&gt;
				</description>
			</item>
		
		
			<item>
				<title>Sango commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment51</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 51</guid>
				<dc:creator>Sango</dc:creator>
				<pubDate>Fri, 12 Aug 2011 10:47:44 GMT</pubDate>
				<description>
					Wow, that is really cool! Worked for me.&lt;br/&gt;&lt;br/&gt;Tried ILMerge as well, did not work. This is really Cool. I will link to this! (So i can remember it for the next time ;))&lt;br/&gt;All those paid solutions have nothing on this one.
				</description>
			</item>
		
		
			<item>
				<title>Simon Cropp commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment50</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 50</guid>
				<dc:creator>Simon Cropp</dc:creator>
				<pubDate>Wed, 10 Aug 2011 23:09:05 GMT</pubDate>
				<description>
					Daniel&lt;br/&gt;&lt;br/&gt;I would be interested on your opinon on this &lt;br/&gt;&lt;a href=&quot;http://code.google.com/p/costura/wiki/HowItWorksEmbedTask&quot;&gt;http://code.google.com/p/costura/wiki/HowItWorksEmbedTask&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;It uses a similar approach to what you have described but does it in IL so it requires much less setup. ie you dont need to write the &amp;quot;AssemblyResolve&amp;quot; method or embedd any resources.&lt;br/&gt;&lt;br/&gt;
				</description>
			</item>
		
		
			<item>
				<title>bbqchickenrobot commented on &quot;Dynamic Queries in Entity Framework using Expression Trees&quot;</title>
				<link>http://www.digitallycreated.net/Blog/37/dynamic-queries-in-entity-framework-using-expression-trees#Comment49</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 49</guid>
				<dc:creator>bbqchickenrobot</dc:creator>
				<pubDate>Mon, 08 Aug 2011 13:23:59 GMT</pubDate>
				<description>
					Ok, answered my own question... the answer is yes. You can create multiple where clauses and chain them. Another question would be how to do and clauses... 
				</description>
			</item>
		
		
			<item>
				<title>bbqchickenrobot commented on &quot;Dynamic Queries in Entity Framework using Expression Trees&quot;</title>
				<link>http://www.digitallycreated.net/Blog/37/dynamic-queries-in-entity-framework-using-expression-trees#Comment48</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 48</guid>
				<dc:creator>bbqchickenrobot</dc:creator>
				<pubDate>Mon, 08 Aug 2011 13:09:41 GMT</pubDate>
				<description>
					So, let's say you have multiple parameters for the where clause... how would one go about implementing that? Is it as simple as creating two where expressions? Great blog post!
				</description>
			</item>
		
		
			<item>
				<title>Gaurav commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment46</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 46</guid>
				<dc:creator>Gaurav</dc:creator>
				<pubDate>Wed, 27 Jul 2011 08:10:35 GMT</pubDate>
				<description>
					Thanks for your article. This is amazing... worked like charm!
				</description>
			</item>
		
		
			<item>
				<title>Sam commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment45</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 45</guid>
				<dc:creator>Sam</dc:creator>
				<pubDate>Mon, 25 Jul 2011 15:51:52 GMT</pubDate>
				<description>
					Daniel,&lt;br/&gt;   Thanks very much for posting this. I can't believe that creating a single-exe deployment was this simple - no external tools needed at all!&lt;br/&gt;&lt;br/&gt;Sam
				</description>
			</item>
		
		
			<item>
				<title>Daniel Chambers commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment44</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 44</guid>
				<dc:creator>Daniel Chambers</dc:creator>
				<pubDate>Thu, 21 Jul 2011 05:56:48 GMT</pubDate>
				<description>
					@Simon: Yes, convoluting your LINQ can degrade your maintainability, however, you might be able to improve the maintainability of the LINQ queries where you've done weird esoteric hacks (such as the ones discussed in the previous blog post I linked at the top of this one) by using an expression rewriter like the one I discussed here:&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://www.digitallycreated.net/Blog/66/sweeping-yucky-linq-queries-under-the-rug-with-expression-tree-rewriting&quot;&gt;http://www.digitallycreated.net/Blog/66/sweeping-yucky-linq-queries-under-the-rug-with-expression-tree-rewriting&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;However, with respect to this blog post, I wouldn't consider the alternative query structure proposed here unmaintainable. In fact, it looks very much like SQL! Your only issue is communicating why the query has been written that way and not some other way, which a process of LINQ best practices education amongst your developers would help with.
				</description>
			</item>
		
		
			<item>
				<title>Simon Raik-Allen commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment43</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 43</guid>
				<dc:creator>Simon Raik-Allen</dc:creator>
				<pubDate>Thu, 21 Jul 2011 01:41:46 GMT</pubDate>
				<description>
					On the flip side, convoluting your source to effect the output could degrade its maintainability. Not that that will always be the case, but its another thing to add to the balancing act. Damned if you do, damned if you don't :-)&lt;br/&gt;&lt;br/&gt;A Linq2Sql cheat sheet for these tips would be cool.&lt;br/&gt;&lt;br/&gt;Thanks, again.
				</description>
			</item>
		
		
			<item>
				<title>Daniel Chambers commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment42</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 42</guid>
				<dc:creator>Daniel Chambers</dc:creator>
				<pubDate>Thu, 21 Jul 2011 00:09:13 GMT</pubDate>
				<description>
					@Simon: Short answer: it depends. :)&lt;br/&gt;&lt;br/&gt;Long answer: It depends (ha!) just how much pain LINQ is giving you, and how difficult it is to fit SQL into your application. Entity Framework lessens the pain as the LINQ query provider is better. L2S and EF both support compiled queries, so you can reduce the performance impact of using LINQ. At the end of the day, however, if you simply can't get LINQ to generate reasonably performing SQL (note that I didn't say &amp;quot;neat&amp;quot; SQL; who cares what it looks like so long as it performs acceptably) you've always got the option of hooking stored procedures into either L2S or EF. My experience with LINQ so far is that you can almost always get it to write decent SQL... with some tweaks to the LINQ. And as you discover and learn these tweaks, your productivity in LINQ increases. L2S is harder to get right, as it'll happily do stupid stuff like N+1 queries generated from your one LINQ query. EF won't do that, which helps immensely.
				</description>
			</item>
		
		
			<item>
				<title>Simon Raik-Allen commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment41</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 41</guid>
				<dc:creator>Simon Raik-Allen</dc:creator>
				<pubDate>Wed, 20 Jul 2011 10:11:59 GMT</pubDate>
				<description>
					Nice post Daniel. I tend to find myself falling back to writing manual SQL for basically anything of importance (i.e., pulls lots of data or is called often). &lt;br/&gt;&lt;br/&gt;What is your guideline for when to intervene with hand-crafted queries?
				</description>
			</item>
		
		
			<item>
				<title>Source Code commented on &quot;Deep Inside ASP.NET MVC 2 Model Metadata and Validation&quot;</title>
				<link>http://www.digitallycreated.net/Blog/54/deep-inside-asp.net-mvc-2-model-metadata-and-validation#Comment39</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 39</guid>
				<dc:creator>Source Code</dc:creator>
				<pubDate>Fri, 08 Jul 2011 18:45:10 GMT</pubDate>
				<description>
					I have a question, When I apply a validation attribute (which is having associated validator to it) twice on a property,  for eg I have number1 which should be lesser than number2 and number3. so I apply something like below.&lt;br/&gt;[LessThan(&amp;quot;Number2&amp;quot;,ErrorMessage=)]&lt;br/&gt;[LessThan(&amp;quot;Number3&amp;quot;,ErrorMessage=)]&lt;br/&gt;public int Number1&lt;br/&gt;&lt;br/&gt;problem here is when it evaluates Number1 &amp;lt; Number3 to true, then it is not checking for Number1 &amp;lt;Number2, it assumes that validation for the whole field is passed. How can we ensure, we go through each validation (attribute rule) and make sure the correct Validation error is returned. 
				</description>
			</item>
		
		
			<item>
				<title>Tarun commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment38</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 38</guid>
				<dc:creator>Tarun</dc:creator>
				<pubDate>Wed, 06 Jul 2011 06:24:13 GMT</pubDate>
				<description>
					Hello, i just created my first  wpf app in VS2010, i am not able to figure out where should i paste the target xaml code?(where standard Microsoft.CSharp.targets file is imported, didn't made any sense to me, pls provide a bit more detail)
				</description>
			</item>
		
		
			<item>
				<title>greenaj commented on &quot;Combining multiple assemblies into a single EXE for a WPF application&quot;</title>
				<link>http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application#Comment37</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 37</guid>
				<dc:creator>greenaj</dc:creator>
				<pubDate>Thu, 02 Jun 2011 20:00:53 GMT</pubDate>
				<description>
					I am using this already after having read your tip.  It seems that this can be used for vanilla WinForms and console applications also.&lt;br/&gt;&lt;br/&gt;--aris&lt;br/&gt;blog: &lt;a href=&quot;http://www.level533.com&quot;&gt;http://www.level533.com&lt;/a&gt;
				</description>
			</item>
		
		
			<item>
				<title>sib commented on &quot;Entity Framework, TransactionScope and MSDTC&quot;</title>
				<link>http://www.digitallycreated.net/Blog/48/entity-framework-transactionscope-and-msdtc#Comment36</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 36</guid>
				<dc:creator>sib</dc:creator>
				<pubDate>Thu, 19 May 2011 09:11:07 GMT</pubDate>
				<description>
					Thanks a lot! You saved my day. The main reason we do not want to use MS DTC is because it can be turned off on client servers or can lack network permissions and deployment becomes nightmare!
				</description>
			</item>
		
		
		
	</channel>
</rss>

