JetBrains Rider 2021.1 Help

Predefined Live Templates

This topic lists all predefined Live templates in JetBrains Rider 2021.1.

Live/Surround templates can be used for generating code in existing files and (if there is the $SELECTION$ parameter in the template body) for surrounding code fragments with template code, such as try...catch statement.
Each live template is identified by a Shortcut— a short string of characters, for example foreach— that you can type right in the editor to invoke the template.

Index of Live Templates

TemplateDescription
C#
ctxCurrent file context
nguidInsert new GUID
joinJoin clause in language integrated query
fromLanguage-Integrated Query
foreachforeach block
itliIterate a IList<T>
itarIterate an array
ritarIterate an array in inverse order
forSimple "for" loop
sfcSafely cast variable
psvmThe "Main" method declaration
outvPrint value of a variable
outPrint a string
asrtMake an assertion
asrtnAssert expression not null
thrthrow new
pcipublic const int
pcspublic const string
psrpublic static readonly
propProperty
earCreate an empty array
#if
#region
enum
elseelse statement
~Destructor
ctorConstructor
cwConsole.WriteLine
class
Exception
struct
forrReverse 'for' loop
namespace
interface
sim'int Main' method
indexer
svm'void Main' method
unsafeunsafe statement
uncheckedunchecked block
tryftry finally
trytry catch
switchswitch statement
whilewhile loop
iteratorsimple iterator
propgProperty with a 'get' accessor and a private 'set' accessor
AttributeAttribute using recommended pattern
dodo...while loop
checkedchecked block
ifif statement
locklock statement
mboxMessageBox.Show
usingusing statement
halASP.NET MVC Html.ActionLink
uaASP.NET MVC Url.Action
rtaASP.NET Controller RedirectToAction
attachedPropertyAttached property
dependencyPropertyDependency property
test
VB.NET
ctxCurrent file context
nguidInsert new GUID
foreachFor Each block
itarIterate an array
itliIterate generic System.Collections.Generic.IList(Of T)
forSimple "For" loop
ritarIterate array in reverse order
DimDeclare a variable
asrtMake an assertion
outPrint a string
outvPrint value of an expression
pssmPublic Shared Sub Main
sfcSafely cast a variable
subSubroutine declaration
funFunction declaration
dcDirectCast clause
tcTryCast clause
ctCType clause
ByRefByRef parameter
ByValByVal parameter
selSelect case statement
attachedPropertyAttached property
dependencyPropertyDependency property
ASP.NET
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
tCreate ASP.NET tag
tcCreate closed tag
aCreate tag attribute
<asp:HyperLinkASP.NET Hyperlink
foreachforeach block
Razor
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
tCreate tag
tcCreate closed tag
aCreate tag attribute
@inheritsRazor inherits directive
@modelRazor model directive
@sectionRazor section
Last modified: 25 March 2021