<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/c-sharp/tags/extension</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 11:58:10 GMT</pubDate>
<item>
<title>(C#) C# LINQ &amp;amp; Extension method continued - ed_trench</title>
<link>http://snipplr.com/view/67680/c-linq--extension-method-continued/</link>
<description><![CDATA[ <p>Also extended C# LINQ and Extension method (simple) to include the last (MAX) Date Created property, added a new Folder class (model) with properties and included them in a List. Also, amended the LINQ statement to get the MAX(Date Created) .</p> ]]></description>
<pubDate>Thu, 11 Oct 2012 01:35:47 GMT</pubDate>
<guid>http://snipplr.com/view/67680/c-linq--extension-method-continued/</guid>
</item>
<item>
<title>(C#) MVC Checkboxlist - sommertim</title>
<link>http://snipplr.com/view/58384/mvc-checkboxlist/</link>
<description><![CDATA[ <p>Code snippet that allows developers to use a generic radiobuttonlist in the MVC Framework</p> ]]></description>
<pubDate>Fri, 02 Sep 2011 02:05:08 GMT</pubDate>
<guid>http://snipplr.com/view/58384/mvc-checkboxlist/</guid>
</item>
<item>
<title>(C#) MVC RadioButtonList - sommertim</title>
<link>http://snipplr.com/view/58383/mvc-radiobuttonlist/</link>
<description><![CDATA[ <p>Code snippet that allows developers to use a generic radiobuttonlist in the MVC Framework</p> ]]></description>
<pubDate>Fri, 02 Sep 2011 02:02:18 GMT</pubDate>
<guid>http://snipplr.com/view/58383/mvc-radiobuttonlist/</guid>
</item>
<item>
<title>(C#) TruncateOnWordBoundary - a useful extension method for cutting a string short, but not in the middle of a word. - stewartrae</title>
<link>http://snipplr.com/view/54319/truncateonwordboundary--a-useful-extension-method-for-cutting-a-string-short-but-not-in-the-middle-of-a-word/</link>
<description><![CDATA[ <p>Ever wanted a method that can truncate a string, but only on a word boundary? This method works like Substring() but doesn't snip a string in the middle of a word, i.e. it only truncates the string on a word boundary. Useful for producing a summary from long text, or when limiting the length of an input field.</p> ]]></description>
<pubDate>Tue, 24 May 2011 17:02:11 GMT</pubDate>
<guid>http://snipplr.com/view/54319/truncateonwordboundary--a-useful-extension-method-for-cutting-a-string-short-but-not-in-the-middle-of-a-word/</guid>
</item>
<item>
<title>(C#) System Object extensions for easier conditionals (Extending Base Object Types) - bryanlyman</title>
<link>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</link>
<description><![CDATA[ <p>.net 3.0+, To create stability in your code, you must check all inputs into a method to make sure they are valid . Often people overlook this step because of laziness, or because they aren't convinced that exceptions and assertions are actually in place to help you instead of cause you a headache. Here are some extensions which can be used to enhance the System.Object class so that their methods are global to all classes; this makes input checking effortless. This is also somewhat generic in nature because the extensions take no class type in to account before they are called, but we can use type checking to perform different boxing (casting) operations.  Sadly this cannot be done in VB.net because late binding restrictions do not allow the Object class to be extended (See my VB.Net example for further information).</p> ]]></description>
<pubDate>Sat, 21 May 2011 02:48:17 GMT</pubDate>
<guid>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</guid>
</item>
<item>
<title>(C#) additonal fluent validation extension method for working with collection - marktaichen</title>
<link>http://snipplr.com/view/49723/additonal-fluent-validation-extension-method-for-working-with-collection/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 26 Feb 2011 09:58:39 GMT</pubDate>
<guid>http://snipplr.com/view/49723/additonal-fluent-validation-extension-method-for-working-with-collection/</guid>
</item>
<item>
<title>(C#) Fluent Validation extension method - marktaichen</title>
<link>http://snipplr.com/view/49721/fluent-validation-extension-method/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 26 Feb 2011 08:48:57 GMT</pubDate>
<guid>http://snipplr.com/view/49721/fluent-validation-extension-method/</guid>
</item>
<item>
<title>(C#) In &amp;amp; NotIn extension methods - mattcasto</title>
<link>http://snipplr.com/view/33651/in--notin-extension-methods/</link>
<description><![CDATA[ <p>I love creating simple little extension methods like these to improve code readability.</p> ]]></description>
<pubDate>Fri, 30 Apr 2010 07:46:16 GMT</pubDate>
<guid>http://snipplr.com/view/33651/in--notin-extension-methods/</guid>
</item>
<item>
<title>(C#) In &amp;amp; NotIn extension methods - mattcasto</title>
<link>http://snipplr.com/view/33650/in--notin-extension-methods/</link>
<description><![CDATA[ <p>I love creating simple little extension methods like this to make my code read more better.</p> ]]></description>
<pubDate>Fri, 30 Apr 2010 07:43:19 GMT</pubDate>
<guid>http://snipplr.com/view/33650/in--notin-extension-methods/</guid>
</item>
<item>
<title>(C#) Enum Limitation Fix Using a Generic Class and Implicit Casting - bryanlyman</title>
<link>http://snipplr.com/view/24778/enum-limitation-fix-using-a-generic-class-and-implicit-casting/</link>
<description><![CDATA[ <p>For .net 2.0+   The one limitation to enumerations is revealed when you try to reverse lookup an enumeration value using Enum.Parse(). The parse function will return an inconsistent enum object if ever there are two or more enumerations with the same numeric value. This class fixes that problem. Written as a system extension and using implicit casting, the process has been made extremely easy and made the syntax for the parse function even simpler. The process even allows enumeration names starting with a number or the name of a C# keyword as long as the name is preceded by an underscore. The implicit cast from an Enum object to a Enum.Cast object has been deliberately left out to account for single directional assignment, which forces the class to be used properly. An Enum to Cast object lookup would defeat the whole purpose of the class if the implicit operator is used during runtime; for this purpose a user assignment operator of type String is supplied. This simply forces the user to use Cast = Enum.ToString() to parse to a correct object. The ToString() overload for a Cast object returns a Friendly name which replaces all underscores with spaces and even allows double underscores for commas and triple underscores for periods; for this reason, the implicit \"from string\" caster also converts from a friendly name to the proper Enum object. This makes it very handy for enumerating through a list of items for a combo or list box and converting back to the proper object by simply supplying the name of the list item.</p> ]]></description>
<pubDate>Mon, 14 Dec 2009 18:03:38 GMT</pubDate>
<guid>http://snipplr.com/view/24778/enum-limitation-fix-using-a-generic-class-and-implicit-casting/</guid>
</item>
<item>
<title>(C#) Copy All Object Values from Another Instance of the Same Type Using Reflection - rengber</title>
<link>http://snipplr.com/view/14594/copy-all-object-values-from-another-instance-of-the-same-type-using-reflection/</link>
<description><![CDATA[ <p>Say that you have a collection of objects empty but for IDs.  
You want to do a foreach loop through those objects and lookup detail one at a time.  
Unfortunately, in the foreach, you can't replace the references, you can only copy the new detail into the object.   
This technique will populate your current reference from an object instance returned by a lookup.</p> ]]></description>
<pubDate>Thu, 30 Apr 2009 00:51:06 GMT</pubDate>
<guid>http://snipplr.com/view/14594/copy-all-object-values-from-another-instance-of-the-same-type-using-reflection/</guid>
</item>
<item>
<title>(C#) Playing With Extension Methods - Soft</title>
<link>http://snipplr.com/view/4898/playing-with-extension-methods/</link>
<description><![CDATA[ <p>In Ruby you can write 5.times { print "Hello World" } . With a simple extension method I was able to do something similar with C#.</p> ]]></description>
<pubDate>Mon, 04 Feb 2008 17:39:52 GMT</pubDate>
<guid>http://snipplr.com/view/4898/playing-with-extension-methods/</guid>
</item>
</channel>
</rss>