我創建了具有這樣特徵的的HtmlHelper:lambda表達式意思
public static MvcHtmlString PageLinks(this HtmlHelper html,
PagingInfo pagingInfo,Func<int, string> pageUrl)
,我看到它傳遞這樣的:
@Html.PageLinks(Model.PagingInfo, x => Url.Action("List", new {page = x}))
,但我不知道它是什麼意思?
x => Url.Action("List", new {page = x})
請提出這個lambda表達式
只需補充一點,我認爲您將從閱讀代表中獲益,因爲Func是一個接受int作爲輸入並返回字符串的委託。當涉及到生成你的頁面鏈接,你委託創建你的鏈接到Url.Action –
2011-10-14 16:34:56
@jon什麼將是x的價值? – DotnetSparrow