I manage a project which must generate the body of a personalized email message (HTML) for this I have an auxiliary .cshtml file which is taken as the body of the message. To fill this body in the controller I have a class that obtains the selected object.
static CURSO cursoSelected = new CURSO();
public static CURSO cursoSel()
{
return cursoSelected;
}
But I'm not sure how to call it and use it in the cshtml. I have this idea but it does not work
@model Proyecto.Models.Historial.cursoSel()
and in the section
<body>
<label style="font-size:18px">Curso de</label>@Proyecto.Models.Historial.cursoSel().NOMBRE_CURSO< br />
</body>