<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Custom sorting order in LINQ (ORDER BY WEIGHTING)</title>
	<atom:link href="http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/feed" rel="self" type="application/rss+xml" />
	<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009</link>
	<description>Daniel Skinner&#039;s Blog: Web Development news and articles</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:14:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-14091</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Mon, 05 Apr 2010 09:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-14091</guid>
		<description>Yes, this should work since OrderByWeight is returning an IOrderedEnumerable. You would need to implement the ThenByWeight extension method.</description>
		<content:encoded><![CDATA[<p>Yes, this should work since OrderByWeight is returning an IOrderedEnumerable. You would need to implement the ThenByWeight extension method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: orel zion</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-14089</link>
		<dc:creator>orel zion</dc:creator>
		<pubDate>Wed, 17 Mar 2010 12:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-14089</guid>
		<description>Hi!
Great code.
Is it possible to use the function as a thenBy too?
Like for example 
var data = dt.Select(g =&gt; new
{
    Year = g.year,
}).OrderBy(x=&gt;x.Month).ThenByWeight(a =&gt; a.Year, x =&gt;
{
    if (x.Contains(&quot;2008&quot;)) return 1;
    if (x.Contains(&quot;2009&quot;)) return 2;
    if (x.Contains(&quot;2010&quot;) return 3;
    return 99;
});</description>
		<content:encoded><![CDATA[<p>Hi!<br />
Great code.<br />
Is it possible to use the function as a thenBy too?<br />
Like for example<br />
var data = dt.Select(g =&gt; new<br />
{<br />
    Year = g.year,<br />
}).OrderBy(x=&gt;x.Month).ThenByWeight(a =&gt; a.Year, x =&gt;<br />
{<br />
    if (x.Contains(&#8220;2008&#8243;)) return 1;<br />
    if (x.Contains(&#8220;2009&#8243;)) return 2;<br />
    if (x.Contains(&#8220;2010&#8243;) return 3;<br />
    return 99;<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Supersum</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-12428</link>
		<dc:creator>Supersum</dc:creator>
		<pubDate>Fri, 30 Oct 2009 00:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-12428</guid>
		<description>Nice code, it worked like needed</description>
		<content:encoded><![CDATA[<p>Nice code, it worked like needed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Gruska</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-11878</link>
		<dc:creator>Dave Gruska</dc:creator>
		<pubDate>Fri, 02 Oct 2009 19:15:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-11878</guid>
		<description>This is brilliant. Thank you!</description>
		<content:encoded><![CDATA[<p>This is brilliant. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Skinner</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-7111</link>
		<dc:creator>Daniel Skinner</dc:creator>
		<pubDate>Tue, 28 Apr 2009 18:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-7111</guid>
		<description>I&#039;m glad it was useful. I have used it many times since initially writing it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad it was useful. I have used it many times since initially writing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R.B</title>
		<link>http://www.daniel-skinner.co.uk/custom-sorting-order-in-linq-order-by-weighting/18/03/2009/comment-page-1#comment-7110</link>
		<dc:creator>R.B</dc:creator>
		<pubDate>Tue, 28 Apr 2009 17:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=32#comment-7110</guid>
		<description>Dude, you are cool!

I just used this in my code, and it works really nice.
Very nice.</description>
		<content:encoded><![CDATA[<p>Dude, you are cool!</p>
<p>I just used this in my code, and it works really nice.<br />
Very nice.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
