<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>chillijam.co.uk &#187; Linq</title>
	<atom:link href="http://chillijam.co.uk/category/linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://chillijam.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 28 Jan 2021 10:32:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Using LINQ to randomise a list.</title>
		<link>http://chillijam.co.uk/2011/09/22/using-linq-to-randomise-a-list/</link>
		<comments>http://chillijam.co.uk/2011/09/22/using-linq-to-randomise-a-list/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 14:03:32 +0000</pubDate>
		<dc:creator><![CDATA[Marc]]></dc:creator>
				<category><![CDATA[C# Snippets]]></category>
		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://chillijam.co.uk/?p=359</guid>
		<description><![CDATA[This afternoon I needed to select some random items from a collection, and my searching ran into this idea. I modified it a little to do what I needed (Select 4 items at random from a list), and this is what I came up with&#8230;]]></description>
				<content:encoded><![CDATA[<p>This afternoon I needed to select some random items from a collection, and my searching ran into this idea.</p>
<pre class="brush: csharp; title: ; notranslate">
Random rnd = new Random();
var randomizedList = from item in list
                     orderby rnd.Next()
                     select item;
</pre>
<p>I modified it a little to do what I needed (Select 4 items at random from a list), and this is what I came up with&#8230;</p>
<pre class="brush: csharp; title: ; notranslate">
Random rnd = new Random();
var MyCollection = (from icon in TheOriginalList orderby rnd.Next() select icon).Take(4));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://chillijam.co.uk/2011/09/22/using-linq-to-randomise-a-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
