Last active
July 12, 2019 07:07
-
-
Save jterral/03583986b5c1f23fec38e82c41f3a670 to your computer and use it in GitHub Desktop.
[Snippet][C#] Throw ArgumentNullException is parameter if null.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>throwifnull</Title> | |
<Shortcut>tin</Shortcut> | |
<Description>Code snippet for an automatically implemented throw if null.</Description> | |
<Author>Microsoft Corporation</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>param</ID> | |
<ToolTip>Property name</ToolTip> | |
<Default>param</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"> | |
<![CDATA[$param$ ?? throw new ArgumentNullException(nameof($param$));$end$]]> | |
</Code> | |
<Imports> | |
<Import> | |
<Namespace>System</Namespace> | |
</Import> | |
</Imports> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment