ReSharper 8.0 Web Help

ReSharper | Templates Explorer | Surround Templates | ASP.NET | C#

ASP.net

C#

Template name Description
foreach

Purpose
Puts a selection into a foreach statement block.

<% foreach ($TYPE$ $VARIABLE$ in $COLLECTION$) { %>
$SELECTION$
$END$<%}%>

Before expansion

After expansion

Parameters

  • TYPE - type to cast the array elements to.
  • VARIABLE - iterator variable.
  • COLLECTION - instance to iterate over.
  • SELECTION - selected code.
  • END - position of the caret after applying the template.

See Also

Reference