如何将枚举值传递给@ Html.ActionLink

Dev*_*per 5 .net html c# asp.net-mvc-3

我有一些方法

public ActionResult ExportToCSV(CellSeparators cellSeparator)
{
  //
}          

public enum CellSeparators
{
   Semicolon,
   Comma
}
Run Code Online (Sandbox Code Playgroud)

我们如何在html中正确引用该方法?

@Html.ActionLink("Exportar al CSV", "ExportToCSV", new { ?? })
Run Code Online (Sandbox Code Playgroud)

谢谢!

Alb*_*eón 2

@Html.ActionLink("Exportar CSV", "ExportToCSV", new { cellSeparator=(int)CellSeparators.Semicolon })

public ActionResult ExportToCSV(int cellSeparator)
{
  CellSeparator separator = (CellSeparator)cellSeparator;
}
Run Code Online (Sandbox Code Playgroud)

不优雅,但很有用