<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx</link><description>In the last post i discussed a little bit of background on why we wanted to introduce Linq, as well as a bit of info on what some basic C# Linq looked like. In this post i'm going to dive in a little bit deeper to some other interesting things we're introducing</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470059</link><pubDate>Sat, 17 Sep 2005 12:44:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470059</guid><dc:creator>Frans Bouma</dc:creator><description>All nice and dandy, but you most of the time will have to define types anyway, for the simple reason that the place where you READ data isn't always (most of the time) the place where you consume data. This means that where you consume data you call a method which retrieves the data for you (example: gui calls BL method). &lt;br&gt;&lt;br&gt;Though in the BL method, you can use 'var' all you want, but you can't return it from the method, the method has to have a strong type. Which means that I have to define the type anyway. &lt;br&gt;&lt;br&gt;I'm developing O/R mappers for more than 3 years now and I know the necessity of 'var' seems to come from the fact that a dynamic list has to be stored in a statically defined type, and 'var' 'solves' that'. But only partly as I described above. &lt;br&gt;&lt;br&gt;I more and more get the feeling this 'var' construct is only useful when you directly read the data from the DB in your GUI tier for example. I don't know if Microsoft actually investigated use-cases for this, but I know from my long experience with O/R mapper code and the people who use these things, they absolutely want to separate the data usage tier from the data producing tier, i.e.: they want to avoid at all costs that a GUI developer is able to make shortcuts and read/write to the db directly, thus bypassing BL code. &lt;br&gt;&lt;br&gt;We can discuss this deeper at the summit in a few weeks but I'd like to point out that it looks great at first, this 'var', but the more I think about it, it starts to look like a nice thing to demo and to use in small petprojects but is completely useless in multi-tier applications. </description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470200</link><pubDate>Sat, 17 Sep 2005 15:13:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470200</guid><dc:creator>Ayende Rahien</dc:creator><description>I absolutely agree about var not being nearly as useful as it can be.&lt;br&gt;&lt;br&gt;Beyond that, about DLinq, are the queries being remoted &amp;amp; executed there, or is an SQL statement is prepared from the expression tree and sent to the database?&lt;br&gt;&lt;br&gt;My understanding was that it is the later case, not the first one, but you post seems to say otherwise.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470517</link><pubDate>Sat, 17 Sep 2005 20:21:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470517</guid><dc:creator>senkwe</dc:creator><description>In your last two code samples, I take it there is a comma missing between c.Name and Orders?</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470572</link><pubDate>Sat, 17 Sep 2005 22:03:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470572</guid><dc:creator>Douglas McClean</dc:creator><description>Cyrus,&lt;br&gt;I like this LINQ stuff a lot except for two things:&lt;br&gt;&lt;br&gt;1) DLINQ is great, but it is unfortunate that the object-database mapping metainformation has to live on attributes of the objects. This is unfortunate because I might use the same business type to map to multiple data stores (e.g. to a database for persistent storage and to XML for messaging, or even to a different database on the server vs. the smart client).&lt;br&gt;&lt;br&gt;2) It seems that LINQ query engines have to compile the queries to the underlying query language every time they are executed, which can't be a cheap operation. This is because the query is bound with what would ordinarily be considered query parameters very early on. Thus if I declare a query to find all of a customer's orders based on the customer ID, it seems like DLINQ will have to recompile that query to SQL at each execution (because it will be a different query, because the customer ID will be different in the general case). It seems that introducing something like QueryParameter&amp;lt;T&amp;gt; would allow the query to be defined with a &amp;quot;blank&amp;quot; to be filled in later, precompiled (by calling some method that instructs the query to figure out it's SQL, and keep that in a cache, and maybe even cache a DynamicMethod for mapping types in and out), and then used multiple times later with different values. It seems like (not having measured) that this would be likely to be a significant performance win in many cases. It also seems that it might allow for earlier (compile time or static analysis time) checking of queries for satisfiability against the database metainformation.&lt;br&gt;&lt;br&gt;Keep up the good work!&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470682</link><pubDate>Sun, 18 Sep 2005 00:15:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470682</guid><dc:creator>Cleve Littlefield</dc:creator><description>I agree with the last comment about caching the query, for two other reasons.&lt;br&gt;&lt;br&gt;By parameterizing the query you can also get a cached execution plan and also be more secure because the dynamic data is passed as parameters.&lt;br&gt;&lt;br&gt;I hope that string concatenation is not the method used to build the final query.  The dynamic pieces of the where need to be parameters and the whole query executed using sp_executesql for security.&lt;br&gt;&lt;br&gt;For a hierarchical query, how do we tune in case the SQL it generates is not optimal?  We need a QA like tool that shows the final query output, shows queryplans, and lets us optimize.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470735</link><pubDate>Sun, 18 Sep 2005 04:42:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470735</guid><dc:creator>CyrusN</dc:creator><description>Ayende: &amp;quot;Beyond that, about DLinq, are the queries being remoted &amp;amp; executed there, or is an SQL statement is prepared from the expression tree and sent to the database? &lt;br&gt;&lt;br&gt;My understanding was that it is the later case, not the first one, but you post seems to say otherwise. &amp;quot;&lt;br&gt;&lt;br&gt;What's the difference?  It's an implementation detail that will be determined based on which vendor you choose.  Some implementations might generate SQL and execute it on the server.  Some might remote the entire expression object over to your server and have it execute in say a CLR you have on that side.  Both are possible.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470818</link><pubDate>Sun, 18 Sep 2005 10:45:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470818</guid><dc:creator>Firedancer</dc:creator><description>It really looks complicated to me. Given a choice, I would prefer not to learn a third language to integrate two languages. SQL can really be complex. Also, how do we represent OUTER JOINS or CROSSJOINS in LINQ? &lt;br&gt;&lt;br&gt;Looking at this, I will prefer the traditional SQL in Stored Procedures and access it via ADO.NET. Much easier to work on. Also, I think OR Mappers are easier to understand and more usable. Not sure about others.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#470935</link><pubDate>Sun, 18 Sep 2005 22:48:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470935</guid><dc:creator>damien morton</dc:creator><description>Heres a question about DLinq:&lt;br&gt;&lt;br&gt;given a query, such as:&lt;br&gt;&lt;br&gt;  var q = &lt;br&gt;      from c in customers&lt;br&gt;      where c.City == &amp;quot;Seattle&amp;quot;&lt;br&gt;      select new NameAndAge(c.Name, c.Age);&lt;br&gt;&lt;br&gt;Now, normally this is converted into an expression using extension methods from the System.Query namespace.&lt;br&gt;&lt;br&gt;What would happen if a completely different implementation of those extension methods was imported instead of System.Query. Is DLinq pluggable to that extent?</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471140</link><pubDate>Mon, 19 Sep 2005 11:07:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471140</guid><dc:creator>damien morton</dc:creator><description>a question on anonymous types...&lt;br&gt;&lt;br&gt;I kinda like this new notation, but only as a way of bringing together various query results. Clearly, these anonymous types arent usefull beyond the scope in which they are created, except as a data-holding class that can be reflected over.&lt;br&gt;&lt;br&gt;It would be usefull to be able to constrain these anonymous types to be immutable and/or structs.&lt;br&gt;&lt;br&gt;var cust = [Immutable.Class] new { Name=&amp;quot;foo&amp;quot;, Address=&amp;quot;bar&amp;quot;}&lt;br&gt;&lt;br&gt;var cust = [Immutable.Struct] new  { Name=&amp;quot;foo&amp;quot;, Address=&amp;quot;bar&amp;quot;}&lt;br&gt;&lt;br&gt;or something like that.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471187</link><pubDate>Mon, 19 Sep 2005 15:09:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471187</guid><dc:creator>damien morton</dc:creator><description>One of the more interesting capabilities of SQL is the ability to consisely join two tables:&lt;br&gt;&lt;br&gt;select * from foo join bar on foo.a = bar.a&lt;br&gt;&lt;br&gt;The result of this join will include all the properties of foo and bar. If a new property is added to foo or bar, queries such as the one above dont need to be changed; the added properties propagate naturally through to the result.&lt;br&gt;&lt;br&gt;With LINQ, everything is strongly typed, and as far as I can see, all projections need to be fully specified. If a new property is added to a table, the programmer has to find all references to that table and update any projections in any queries it might participate in.&lt;br&gt;&lt;br&gt;Could be nasty.&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471305</link><pubDate>Mon, 19 Sep 2005 19:17:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471305</guid><dc:creator>Jared Nuzzolillo</dc:creator><description>&amp;quot;This new query syntax is in fact just syntactic sugar that uses patterns to transform itself into the *exact* same C# query that i listed above.&amp;quot;&lt;br&gt;&lt;br&gt;Will that pattern-transforming capability be exposed to the programmer, or is that an implementation detail? If you are here revealing that, in C#, metaprogramming will finally be possible, this particular SQL example is only a tiny glimpse of the many new possibilities.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471402</link><pubDate>Mon, 19 Sep 2005 21:49:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471402</guid><dc:creator>Sean Chase</dc:creator><description>Cyrus, this is very cool stuff for sure! Honestly I share the same concern as Frans Bouma who has a really great O/R mapper product (LLBLGen Pro) that I've been using over the last several months for a client's project. He has nailed an important issue: that most of the time there is either a logical or physical boundary between the data reader and data consumer. For example, imagine a common assembly to hold classes like Customer, Order and the UI calls a BL layer which both reference common.dll to use those entities. LLBLGen Pro uses an adapter to do this. I would absolutely love to see DLINQ provide this kind of model. Of course there is a market for the &amp;quot;unlayered&amp;quot; model that's being demo'd today just like there is a market for people using the SqlDataSource control in ASP.NET with literal T-SQL values embedded right in the page...but that kind of approach is almost useless to me in most cases. Probably a better value for mort. :-)&lt;br&gt;&lt;br&gt;Great post!</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471421</link><pubDate>Mon, 19 Sep 2005 22:19:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471421</guid><dc:creator>kfarmer</dc:creator><description>damien: &amp;quot;With LINQ, everything is strongly typed, and as far as I can see, all projections need to be fully specified. If a new property is added to a table, the programmer has to find all references to that table and update any projections in any queries it might participate in. &lt;br&gt;&lt;br&gt;Could be nasty. &lt;br&gt;&amp;quot;&lt;br&gt;&lt;br&gt;IMHO, shouldn't we consider this to be a view into the database?  Just because a column is added to a table doesn't mean we need to add it to the query.  It's up to the background objects to determine whether or not a column is required, and up to the developer to specify the ones he's actually interested in dealing with.&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471453</link><pubDate>Mon, 19 Sep 2005 23:06:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471453</guid><dc:creator>damien morton</dc:creator><description>kfarmer: I take your point, but this is an example of a philosophical mismatch between a LINQ query and an SQL query.&lt;br&gt;&lt;br&gt;As a C# developer, I am comfortable with explicitly declaring all the properties of interest, however, SQL allows for those properties to be dealt with in bulk. Tutorial-D (Date's alternative to SQL) allows more sophisticated operations on those bulk properties, such as S{ALL&lt;br&gt;BUT CITY, NAME}.&lt;br&gt;&lt;br&gt;Operations for dealing with properties in bulk constitute a kind of dictionary algebra, with support for renaming, merging, and so forth. A general solution in this domain is messy, however you cut it.&lt;br&gt;&lt;br&gt;Im not sure this is a problem, but if it is, its a messy one.&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471655</link><pubDate>Tue, 20 Sep 2005 09:33:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471655</guid><dc:creator>damien morton</dc:creator><description>Jared:&lt;br&gt;&lt;br&gt;&amp;quot;Will that pattern-transforming capability be exposed to the programmer...?&amp;quot;&lt;br&gt;&lt;br&gt;Yes it will - if you assign a lambda expression to a variable of type Expression&amp;lt;T&amp;gt; you can then manipulate the expression tree to your hearts content. &lt;br&gt;&lt;br&gt;Not sure how select expressions are handled.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471678</link><pubDate>Tue, 20 Sep 2005 10:52:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471678</guid><dc:creator>duncan</dc:creator><description>In your code snippet:&lt;br&gt;&lt;br&gt;   var q = &lt;br&gt;      from c in customers&lt;br&gt;      where c.City == &amp;quot;Seattle&amp;quot;&lt;br&gt;      select new {&lt;br&gt;          c.Name,&lt;br&gt;          Orders = &lt;br&gt;              from o in c.Orders&lt;br&gt;              where o.Cost &amp;gt; 1000&lt;br&gt;              select new { o.Cost, o.Date }&lt;br&gt;      };&lt;br&gt;&lt;br&gt;Why is there no 'var ' needed before 'Orders = ' ?</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#471903</link><pubDate>Tue, 20 Sep 2005 21:44:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:471903</guid><dc:creator>SlyW</dc:creator><description>duncan: Because it is inferred from the &amp;quot;select new { o.Cost, o.Date }&amp;quot; portion of the 'subselect'. &lt;br&gt;&lt;br&gt;That is my understanding of it.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472000</link><pubDate>Wed, 21 Sep 2005 00:06:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472000</guid><dc:creator>kfarmer</dc:creator><description>damien:&lt;br&gt;&lt;br&gt;I think that's because the philosophy of LINQ isn't *about* SQL databases: those are a side-attraction.&lt;br&gt;&lt;br&gt;I think Microsoft made a mistake in focussing so much on making the SQL folks comfortable that they've now got a very hard time ahead in explaining the differences between the two.  Part of that mistake was in publishing C-omega:  everyone fell in love with it, even though it had some serious troubles in dealing with embedded SQL.  Now everybody wants C-omega, despite the lower degree of applicability.&lt;br&gt;&lt;br&gt;I don't have my LINQ machine in front of me, but have you tried just selecting the item?  Something like:&lt;br&gt;&lt;br&gt;from c in Customers&lt;br&gt;where c.name = 'Bob'&lt;br&gt;select new { Customer = c, IsBob = true }&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472022</link><pubDate>Wed, 21 Sep 2005 01:02:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472022</guid><dc:creator>damien morton</dc:creator><description>That query does work, I just tested it, but wont work in a regular database.&lt;br&gt;&lt;br&gt;I think that youre right about LINQ not being about SQL databases. &lt;br&gt;&lt;br&gt;A great part of our jobs as programmers is writing queries over our data structures, and the LINQ framework does a lot of that work for us. </description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472056</link><pubDate>Wed, 21 Sep 2005 02:05:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472056</guid><dc:creator>damien morton</dc:creator><description>Oh cool!&lt;br&gt;&lt;br&gt;You can define your own relational operators, such as Where() specialised on types derived from IEnumerable&amp;lt;T&amp;gt;.&lt;br&gt;&lt;br&gt;This is a somewhat inane example, but compare Where() defined for IEnumerable&amp;lt;T&amp;gt; and an equivalent Where() defined for IList&amp;lt;T&amp;gt;. All you need to do is ensure your new extension method is available and type-resolution will select the most specific overload.&lt;br&gt;&lt;br&gt;public static IEnumerable&amp;lt;T&amp;gt; Take&amp;lt;T&amp;gt;(this IEnumerable&amp;lt;T&amp;gt; source, int count) &lt;br&gt;{&lt;br&gt;	if (count &amp;gt; 0) {&lt;br&gt;		foreach (T element in source) {&lt;br&gt;			yield return element;&lt;br&gt;			if (--count == 0) break;&lt;br&gt;		}&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;&lt;br&gt;public static IEnumerable&amp;lt;T&amp;gt; Take&amp;lt;T&amp;gt;(this List&amp;lt;T&amp;gt; source, int count) {&lt;br&gt;	for (int i = 0; i &amp;lt; count; i++)&lt;br&gt;		yield return source[i];&lt;br&gt;}&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472085</link><pubDate>Wed, 21 Sep 2005 03:10:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472085</guid><dc:creator>kfarmer</dc:creator><description>I think you can also do something like:&lt;br&gt;&lt;br&gt;Expression&amp;lt;Func&amp;lt;double, double, double&amp;gt;&amp;gt; Between(this double x, double low, double high) = (double low, double high) =&amp;gt; (low &amp;lt; x &amp;amp;&amp;amp; x &amp;lt; high);&lt;br&gt;&lt;br&gt;var foo = Customers.Where(c =&amp;gt; c.Age.Between(18, 24.5));&lt;br&gt;&lt;br&gt;Lambda's are fun creatures to play with.&lt;br&gt;&lt;br&gt;Again, my machine's at home... </description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472088</link><pubDate>Wed, 21 Sep 2005 03:21:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472088</guid><dc:creator>CyrusN</dc:creator><description>Firedancer: &amp;quot;It really looks complicated to me. Given a choice, I would prefer not to learn a third language to integrate two languages. SQL can really be complex. Also, how do we represent OUTER JOINS or CROSSJOINS in LINQ? &amp;quot;&lt;br&gt;&lt;br&gt;That's why we gave you a choice.  You don't have to use this if you don't want to.&lt;br&gt;&lt;br&gt;&amp;quot;Looking at this, I will prefer the traditional SQL in Stored Procedures and access it via ADO.NET. Much easier to work on. Also, I think OR Mappers are easier to understand and more usable. Not sure about others. &amp;quot;&lt;br&gt;&lt;br&gt;Again, that's why there's a choice.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472090</link><pubDate>Wed, 21 Sep 2005 03:22:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472090</guid><dc:creator>CyrusN</dc:creator><description>Damien: &amp;quot;Heres a question about DLinq: &lt;br&gt;&lt;br&gt;given a query, such as: &lt;br&gt;&lt;br&gt;var q = &lt;br&gt;from c in customers &lt;br&gt;where c.City == &amp;quot;Seattle&amp;quot; &lt;br&gt;select new NameAndAge(c.Name, c.Age); &lt;br&gt;&lt;br&gt;Now, normally this is converted into an expression using extension methods from the System.Query namespace. &lt;br&gt;&lt;br&gt;What would happen if a completely different implementation of those extension methods was imported instead of System.Query. Is DLinq pluggable to that extent? &amp;quot;&lt;br&gt;&lt;br&gt;The &amp;quot;from&amp;quot; syntax has *nothing* to do with System.Sequence.  It is just syntactic sugar that converts it to a pattern.  i.e.  .Where, .Select. &lt;br&gt;&lt;br&gt;So if you're using some other types that define their own Where/Select methods, then you'll be fine.  the &amp;quot;from&amp;quot; comprehension will just end up binding to those.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472091</link><pubDate>Wed, 21 Sep 2005 03:24:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472091</guid><dc:creator>CyrusN</dc:creator><description>Damien: &amp;quot;a question on anonymous types... &lt;br&gt;&lt;br&gt;I kinda like this new notation, but only as a way of bringing together various query results. Clearly, these anonymous types arent usefull beyond the scope in which they are created, except as a data-holding class that can be reflected over. &lt;br&gt;&lt;br&gt;It would be usefull to be able to constrain these anonymous types to be immutable and/or structs. &lt;br&gt;&amp;quot;&lt;br&gt;&lt;br&gt;Right now we're just showing a preview of what we're working on.  there are currently limitations in place in that preview (like not being able to pass &amp;quot;Var&amp;quot; out of a method.  We're actively investigating different approaches to this problem (such as being able to define anonymous types easily so that you can pass them around.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#472972</link><pubDate>Fri, 23 Sep 2005 00:03:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:472972</guid><dc:creator>Ruben</dc:creator><description>Is it just me, or would the XQuery-like syntax&lt;br&gt;&lt;br&gt;var q = for c in customers&lt;br&gt;....... where c.City == &amp;quot;Seattle&amp;quot;&lt;br&gt;....... select c.Name;&lt;br&gt;&lt;br&gt;not be more C#-ish? I could even go for&lt;br&gt;&lt;br&gt;var q = for c in customers&lt;br&gt;....... where c.City == &amp;quot;Seattle&amp;quot;&lt;br&gt;....... return c.Name;&lt;br&gt;&lt;br&gt;But that would probably be a little confusing. Replacing from with for saves you a keyword, and could silence all the complaints about wanting SELECT FROM instead of FROM SELECT.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#473666</link><pubDate>Sun, 25 Sep 2005 06:21:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:473666</guid><dc:creator>CyrusN</dc:creator><description>Ruben:&lt;br&gt;&lt;br&gt;&amp;quot;Is it just me, or would the XQuery-like syntax &lt;br&gt;&lt;br&gt;var q = for c in customers &lt;br&gt;....... where c.City == &amp;quot;Seattle&amp;quot; &lt;br&gt;....... select c.Name; &lt;br&gt;&lt;br&gt;not be more C#-ish? I could even go for&amp;quot;&lt;br&gt;&lt;br&gt;That would be fine.&lt;br&gt;&lt;br&gt;&amp;quot;var q = for c in customers &lt;br&gt;....... where c.City == &amp;quot;Seattle&amp;quot; &lt;br&gt;....... return c.Name;&amp;quot;&lt;br&gt;&lt;br&gt;I like that less.  The return would be extrmely confusing.</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#474157</link><pubDate>Tue, 27 Sep 2005 00:58:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:474157</guid><dc:creator>kfarmer</dc:creator><description>How about&lt;br&gt;&lt;br&gt;&amp;quot;for c in customers &lt;br&gt;where c.City == &amp;quot;Seattle&amp;quot; &lt;br&gt;yield c.Name;&amp;quot; &lt;br&gt;&lt;br&gt;Yield fits in with the generator idea that this is making use of.&lt;br&gt;&lt;br&gt;One might also use foreach instead of for, if an unambiguous syntax can be had in that case.&lt;br&gt;</description></item><item><title>re: So what's the deal with this whole C# 3.0 / Linq thingy? (Part 2)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#483936</link><pubDate>Sun, 23 Oct 2005 10:29:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:483936</guid><dc:creator>Mark Blomsma</dc:creator><description>The scope of 'var' obviously needs to be greater than just within a method.&lt;br&gt;&lt;br&gt;Some queries will get to be very long. How can you refactor this if your scope is limited?</description></item><item><title>linq select column as literal</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#8825258</link><pubDate>Mon, 04 Aug 2008 04:18:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8825258</guid><dc:creator>linq select column as literal</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://yasmin.getyourfreefitnessvideo.info/linqselectcolumnasliteral.html"&gt;http://yasmin.getyourfreefitnessvideo.info/linqselectcolumnasliteral.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Cyrus Blather So what s the deal with this whole C 3 0 Linq | Cellulite Creams</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#9712437</link><pubDate>Tue, 09 Jun 2009 06:13:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9712437</guid><dc:creator> Cyrus Blather So what s the deal with this whole C 3 0 Linq | Cellulite Creams</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://cellulitecreamsite.info/story.php?id=771"&gt;http://cellulitecreamsite.info/story.php?id=771&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Cyrus Blather So what s the deal with this whole C 3 0 Linq | storage bench</title><link>http://blogs.msdn.com/cyrusn/archive/2005/09/16/469953.aspx#9782670</link><pubDate>Fri, 19 Jun 2009 11:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9782670</guid><dc:creator> Cyrus Blather So what s the deal with this whole C 3 0 Linq | storage bench</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://thestoragebench.info/story.php?id=2487"&gt;http://thestoragebench.info/story.php?id=2487&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>