JetBrains Rider 2021.2 Help

Predefined Live Templates

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

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

Template

Description

C#

copyright

NUnit Copyright

something

ctx

Current file context

nguid

Insert new GUID

join

Join clause in language integrated query

from

Language-Integrated Query

foreach

foreach block

itli

Iterate a IList<T>

itar

Iterate an array

ritar

Iterate an array in inverse order

for

Simple "for" loop

sfc

Safely cast variable

psvm

The "Main" method declaration

outv

Print value of a variable

out

Print a string

asrt

Make an assertion

asrtn

Assert expression not null

thr

throw new

pci

public const int

pcs

public const string

psr

public static readonly

prop

Property

ear

Create an empty array

#if

#region

enum

else

else statement

~

Destructor

ctor

Constructor

cw

Console.WriteLine

class

Exception

struct

forr

Reverse 'for' loop

namespace

interface

sim

'int Main' method

indexer

svm

'void Main' method

unsafe

unsafe statement

unchecked

unchecked block

tryf

try finally

try

try catch

switch

switch statement

while

while loop

iterator

simple iterator

propg

Property with a 'get' accessor and a private 'set' accessor

Attribute

Attribute using recommended pattern

do

do...while loop

checked

checked block

if

if statement

lock

lock statement

mbox

MessageBox.Show

using

using statement

hal

ASP.NET MVC Html.ActionLink

ua

ASP.NET MVC Url.Action

rta

ASP.NET Controller RedirectToAction

attachedProperty

Attached property

dependencyProperty

Dependency property

VB.NET

ctx

Current file context

nguid

Insert new GUID

foreach

For Each block

itar

Iterate an array

itli

Iterate generic System.Collections.Generic.IList(Of T)

for

Simple "For" loop

ritar

Iterate array in reverse order

Dim

Declare a variable

asrt

Make an assertion

out

Print a string

outv

Print value of an expression

pssm

Public Shared Sub Main

sfc

Safely cast a variable

sub

Subroutine declaration

fun

Function declaration

dc

DirectCast clause

tc

TryCast clause

ct

CType clause

ByRef

ByRef parameter

ByVal

ByVal parameter

sel

Select case statement

attachedProperty

Attached property

dependencyProperty

Dependency property

Razor

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

t

Create tag

tc

Create closed tag

a

Create tag attribute

@inherits

Razor inherits directive

@model

Razor model directive

@section

Razor section

ASP.NET

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

t

Create ASP.NET tag

tc

Create closed tag

a

Create tag attribute

<asp:HyperLink

ASP.NET Hyperlink

foreach

foreach block

Last modified: 21 October 2021