I want to pass my ViewModel(not IEnumerable) to my custom html helper
I was doing on IEnumerable like this:
Helper:
public static IHtmlString GenerateTable<TModel, TValue>(this HtmlHelper<TModel> inHtml, IEnumerable<TValue> model)
View:
@Html.GenerateTable(Model)
But how i can pass model which is not IEnumerable to helper?
I Tried this:
public static MvcHtmlString MyHelper<TModel>(this HtmlHelper<TModel> html, object obj)
{}
but when i call it like this
@Html.MyHelper(Model)
obj is always NULL
Modelis not null when calling@Html.MyHelper(Model)?