Predefined File Templates for Razor (C#)
This topic lists all predefined file templates for Razor (C#) in ReSharper 2019.3. For more information about file templates, see Create Files from Templates
Template | Details |
---|---|
Razor MVC Partial View | Razor MVC Partial View Scope Razor (C#) projects, Razor (C#) Views folder Body @model $model$
$END$ Parameters
|
Razor MVC View | Razor MVC View Scope Razor (C#) projects, Razor (C#) Views folder Body @model $model$
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>$title$</title>
</head>
<body>
<div>
$END$
</div>
</body>
</html> Parameters
|
Razor MVC View with Layout | Razor MVC View with Layout Scope Razor (C#) projects, Razor (C#) Views folder Body @model $model$
@{
ViewBag.Title = "$title$";
Layout = "$_Layout$";
}
<h2>$title$</h2>
$END$ Parameters
|
Controller | Scope Razor ASP.NET Framework projects Body $HEADER$using System.Web.Mvc;
namespace $NAMESPACE$
{
public class $CLASS$: Controller
{
// GET
public ActionResult Index()
{
$END$return View();
}
}
} Parameters
|
Controller | Scope Razor ASP.NET Core projects Body $HEADER$using Microsoft.AspNetCore.Mvc;
namespace $NAMESPACE$
{
public class $CLASS$: Controller
{
// GET
public IActionResult Index()
{
$END$return View();
}
}
} Parameters
|