Pregunta

¿por qué recibo el error " Clase esperada, interfaz, enumeración o estructura " con una cuerda subrayada?

 public static string IsSelected(this HtmlHelper helper, string A, string B)

    {
         return "wtf";

    }
¿Fue útil?

Solución

Su método de extensión debe estar dentro de una clase estática:

public static class MyExtensions
{
    public static string IsSelected( this HtmlHelper helper, string A, string B)
    {
        return "wtf";

    }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top