Skip to content

Instantly share code, notes, and snippets.

@fabianobizarro
Created November 23, 2021 21:05
Show Gist options
  • Save fabianobizarro/e332afc6320db73db5796e1b6d99c193 to your computer and use it in GitHub Desktop.
Save fabianobizarro/e332afc6320db73db5796e1b6d99c193 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>prop init</Title>
<Shortcut>propinit</Shortcut>
<Description>Code snippet for an automatically implemented property with init instead of set
Language Version: C# 9.0 or higher</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property name</ToolTip>
<Default>MyProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public $type$ $property$ { get; init; }$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment