简体   繁体   中英

C# to VB.Net conversion assistance

I have the the following C# code:

public static MvcHtmlString ExtendedDropDownListFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IEnumerable<ExtendedSelectListItem> selectList, string optionLabel, object htmlAttributes)
{
    return SelectInternal(htmlHelper, optionLabel, ExpressionHelper.GetExpressionText(expression), selectList, false /* allowMultiple */, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
}

I am struggling with a VB conversion of this and was wondering if someone could assist. Specifically, the line in the function signature:

Expression<Func<TModel, TProperty>> expression

Thanks for any help.

expression As Expression(Of Func(Of TModel, TProperty))

My bad fellow members, it was a namespace issue.

I just needed to add an imports:

Imports System.Linq.Expressions

I guess I should have dug in a little deeper before I asked. :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM