<?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>Codepolice.net &#187; array</title>
	<atom:link href="http://codepolice.net/tag/array/feed/" rel="self" type="application/rss+xml" />
	<link>http://codepolice.net</link>
	<description>C#, ASP.NET, MVC, LINQ, Wordpress and stuff like that</description>
	<lastBuildDate>Mon, 26 Jul 2010 08:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>IN queries with LINQ to SQL</title>
		<link>http://codepolice.net/2010/06/01/in-queries-with-linq-to-sql/</link>
		<comments>http://codepolice.net/2010/06/01/in-queries-with-linq-to-sql/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 13:33:12 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[in]]></category>
		<category><![CDATA[Linq to sql]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[string array]]></category>

		<guid isPermaLink="false">http://codepolice.net/?p=277</guid>
		<description><![CDATA[This is another awesome feature in LINQ to SQL that i always forget about. Sometimes you have an array of strings or any other type and want to query the database for all values that have one of the values in the array. string platform = "windows&#124;linux"; string[] platformList = platform.Split('&#124;'); itemQuery = from m [...]]]></description>
			<content:encoded><![CDATA[<p>This is another awesome feature in LINQ to SQL that i always forget about. Sometimes you have an array of strings or any other type and want to query the database for all values that have one of the values in the array.</p>
<pre class="brush:c#">string platform = "windows|linux";
string[] platformList = platform.Split('|');
itemQuery = from m in itemQuery
from p in m.PlattformItemRelations
where platformList.Contains(p.Plattform.Text.ToLower())
select m;</pre>
<p>Ain&#8217;t that a beauty? I got this tip from <a href="http://blog.wekeroad.com/2008/02/27/creating-in-queries-with-linq-to-sql/">Ron Connery</a> so all the kudos to him.</p>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2010/06/01/in-queries-with-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a comma separated list with LINQ in C#</title>
		<link>http://codepolice.net/2010/04/20/create-a-comma-separated-list-with-linq-in-c/</link>
		<comments>http://codepolice.net/2010/04/20/create-a-comma-separated-list-with-linq-in-c/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 13:29:59 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://codepolice.net/?p=274</guid>
		<description><![CDATA[For some reason I always forget that you do not do .Join on your actual string array. So i might as well write it down here so i never forget about this again. string mycommalist = string.Join(",", alternatives.Select(x=>x.Item.Name).ToArray())]]></description>
			<content:encoded><![CDATA[<p>For some reason I always forget that you do not do .Join on your actual string array. So i might as well write it down here so i never forget about this again.</p>
<pre class="brush:c#">string mycommalist = string.Join(",", alternatives.Select(x=>x.Item.Name).ToArray())</pre>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2010/04/20/create-a-comma-separated-list-with-linq-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert String Array to Int Array and vice versa in C#</title>
		<link>http://codepolice.net/2009/11/07/convert-string-array-to-int-array-and-vice-versa-in-c/</link>
		<comments>http://codepolice.net/2009/11/07/convert-string-array-to-int-array-and-vice-versa-in-c/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 15:35:17 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[int array]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string array]]></category>

		<guid isPermaLink="false">http://codepolice.net/?p=181</guid>
		<description><![CDATA[Sometimes you want to convert arrays back and forth. This is to nice extension methods to convert a int array into a string array and vice versa. public static class ExtensionMethods { public static string[] ToStringArray(this int[] intArray) { return Array.ConvertAll&#60;int, string&#62;(intArray, delegate(int intParameter) { return intParameter.ToString(); }); } public static int[] ToIntArray(this string[] strArray) [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to convert arrays back and forth. This is to nice extension methods to convert a int array into a string array and vice versa.</p>
<pre class="brush:c#">public static class ExtensionMethods {

  public static string[] ToStringArray(this int[] intArray) {
   return Array.ConvertAll&lt;int, string&gt;(intArray, delegate(int intParameter) { return intParameter.ToString(); });
  }

  public static int[] ToIntArray(this string[] strArray) {
   return Array.ConvertAll&lt;string, int&gt;(strArray, delegate(string intParameter) { return int.Parse(intParameter.ToString()); });
  }
}</pre>

]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2009/11/07/convert-string-array-to-int-array-and-vice-versa-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->