<p>What are the best code snippets for C#? (using visual studio)  VB has a lot that are pre-defined, but there are only a handful for C#.  Do you have any really useful ones for C#?</p>

<p>Anyone want to post a good custom one you created yourself?</p>

<p><a href="http://en.wikipedia.org/wiki/Ferris_Bueller" rel="noreferrer">Anyone?... Bueller?</a></p>

[{'answer_id': 47968, 'author': 'Martin Clarke', 'author_id': 2422, 'author_profile': 'https://Stackoverflow.com/users/2422', 'pm_score': 1, 'selected': False, 'text': '<p>prop and exception are my favorites.</p>\n'}, {'answer_id': 47969, 'author': 'Shane K', 'author_id': 4643, 'author_profile': 'https://Stackoverflow.com/users/4643', 'pm_score': 3, 'selected': False, 'text': '<p>There\'s plenty of code snippets within Visual Studio for basic programming structure but I wouldn\'t necessarily rate one higher than another. </p>\n\n<p>I would definitely say the best ones are the custom snippets you define yourself to accomplish more specific tasks that you may find yourself using on a regular basis. Definitely a big time saver. </p>\n\n<p>A fairly basic intro to creating custom snippets can be found at <a href="http://www.15seconds.com/issue/080724.htm" rel="noreferrer">http://www.15seconds.com/issue/080724.htm</a> to help with this.</p>\n'}, {'answer_id': 48064, 'author': 'David Basarab', 'author_id': 2469, 'author_profile': 'https://Stackoverflow.com/users/2469', 'pm_score': 2, 'selected': False, 'text': '<p>These are the ones I use daily.</p>\n\n<ul>\n<li>prop</li>\n<li>try</li>\n<li>if</li>\n<li>else</li>\n<li>for</li>\n<li>foreach</li>\n<li>mbox - Message box stub</li>\n<li>The ability to role your own.  I have one for Property that are saved in the view state, methods a custom class example.</li>\n</ul>\n'}, {'answer_id': 1053166, 'author': 'Thorsten Lorenz', 'author_id': 97443, 'author_profile': 'https://Stackoverflow.com/users/97443', 'pm_score': 1, 'selected': False, 'text': '<p>I just started a blog, where I document short solutions in C# (code snippets) that I came up with and might prove useful to other coders.</p>\n\n<p><a href="http://thorstenlorenz.blogspot.com/" rel="nofollow noreferrer">http://thorstenlorenz.blogspot.com/</a></p>\n\n<p>So far I have mostly blogged about extension methods and generics.</p>\n\n<p>So have a look and tell me what you think.</p>\n'}, {'answer_id': 1053225, 'author': 'Dario', 'author_id': 105459, 'author_profile': 'https://Stackoverflow.com/users/105459', 'pm_score': 3, 'selected': False, 'text': '<p>My absolute favorite is <code>cw</code>. </p>\n'}, {'answer_id': 1053276, 'author': 'Mark Seemann', 'author_id': 126014, 'author_profile': 'https://Stackoverflow.com/users/126014', 'pm_score': 2, 'selected': False, 'text': '<p>I had a few on my old blog:</p>\n\n<ul>\n<li><a href="http://blogs.msdn.com/ploeh/archive/2008/12/01/testmethod-code-snippet.aspx" rel="nofollow noreferrer">testmethod Code Snippet</a></li>\n<li><a href="http://blogs.msdn.com/ploeh/archive/2006/03/17/oneventCodeSnippet.aspx" rel="nofollow noreferrer">onevent Code Snippet</a></li>\n<li><a href="http://blogs.msdn.com/ploeh/archive/2007/06/25/cleantestresultsXMLSnippet.aspx" rel="nofollow noreferrer">cleantestresults Code Snippet</a></li>\n<li><a href="http://blogs.msdn.com/ploeh/archive/2006/03/20/astypeCodeSnippet.aspx" rel="nofollow noreferrer">astype Code Snippet</a></li>\n</ul>\n\n<p>I also have an <code>argnull</code> code snippet that inserts a Guard Clause that checks an argument for null and throws an ArgumentNullException, but I haven\'t gotten around to post that yet.</p>\n'}, {'answer_id': 1079575, 'author': 'Andy Patrick', 'author_id': 36978, 'author_profile': 'https://Stackoverflow.com/users/36978', 'pm_score': 3, 'selected': True, 'text': '<p>Microsoft have released a whole bunch of C# snippets that bring it up to parity with the ones for Visual Basic. You can download them here:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/z41h7fat.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/z41h7fat.aspx</a></p>\n'}, {'answer_id': 2517732, 'author': 'Craig', 'author_id': 301898, 'author_profile': 'https://Stackoverflow.com/users/301898', 'pm_score': 1, 'selected': False, 'text': '<p>Just to update an older thread... here\'s a link for Visual Studio 2008 C# code snippet download.</p>\n\n<p><a href="http://www.codeplex.com/snippetlibcsharp" rel="nofollow noreferrer">VS 2008 C# Code Snippet Download</a></p>\n'}]
['https://Stackoverflow.com/questions/47960', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1874/']