I'm creating a strongly typed helper (ref: SO question). As 'commented' in the code below, is it possible to somehow get the value from the expressed property and thus bypass the optional selectedValue
parameter?
<Extension()> _
Public Function DatePickerFor(Of TModel As Class, TProperty)(ByVal htmlHelper As HtmlHelper(Of TModel), ByVal expression As Expression(Of Func(Of TModel, TProperty)), Optional ByVal selectedValue As Nullable(Of Date) = Nothing) As MvcHtmlString
Dim inputName = ExpressionHelper.GetExpressionText(expression)
Dim inputValue = selectedValue
//Something like this possible?
//inputValue = ExpressionHelper.GetExpressionValue(expression)
Return DatePicker(htmlHelper, inputName, inputValue)
End Function