﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Dreaming in Code: Multi Linq</title><description>Theoretically, yes.
  
But consider complex expressions, that is not something that I would like to do inline
</description><link>http://ayende.com/2590/dreaming-in-code-multi-linq#comment4</link><guid>http://ayende.com/2590/dreaming-in-code-multi-linq#comment4</guid><pubDate>Mon, 25 Jun 2007 05:55:22 GMT</pubDate></item><item><title>Matt Warren commented on Dreaming in Code: Multi Linq</title><description>If your Add method took a lambda expression you could have your Count query w/o executing it prematurely.
  
  
new  LinqQueryBatch()
  
   .Add( () =&gt; posts)
  
   .Add( () =&gt; posts.Count() )
  
   .Execute();
  
  
However, it would possibly cleaner to simply have an execute method that took one or more lambda's to execute.
  
  
LinqQueryBatch.Execute( () =&gt; posts, () =&gt; posts.Count() );
  
</description><link>http://ayende.com/2590/dreaming-in-code-multi-linq#comment3</link><guid>http://ayende.com/2590/dreaming-in-code-multi-linq#comment3</guid><pubDate>Mon, 25 Jun 2007 02:09:42 GMT</pubDate></item><item><title>Ayende Rahien commented on Dreaming in Code: Multi Linq</title><description>Jeff, I agree, but I don't see any other option to do it, frankly.
  
I would have returned an Int32Proxy, but that is not something that is possible :-)
</description><link>http://ayende.com/2590/dreaming-in-code-multi-linq#comment2</link><guid>http://ayende.com/2590/dreaming-in-code-multi-linq#comment2</guid><pubDate>Sun, 24 Jun 2007 10:36:09 GMT</pubDate></item><item><title>Jeff Brown commented on Dreaming in Code: Multi Linq</title><description>It's a good start.
  
  
Hmm... Won't "posts.Count()" force posts to be evaluated?  It doesn't just wrap "posts" with a new "IEnumerable&lt;T&gt;" which can be evaluated on demand.  It really wants to return an "int" immediately.  That's the kind of thing I was worried about with Multi-LINQ.
  
  
I suppose we can define Count() in a non-standard way to return an IEnumerable&lt;int&gt; instead.  Looks like that's what you're doing up there actually.  Just not sure whether it'll play nice with standard LINQ idioms.
  
  
(I hope this doesn't turn into another one of those irritating syntax gotchas in C# like with event raising in Rhino.Mocks...)
</description><link>http://ayende.com/2590/dreaming-in-code-multi-linq#comment1</link><guid>http://ayende.com/2590/dreaming-in-code-multi-linq#comment1</guid><pubDate>Sun, 24 Jun 2007 10:03:28 GMT</pubDate></item></channel></rss>