What is the difference between these 2 definitions

2019-07-08 11:11发布

问题:

In my razor view I have the following:

   var url = "@Url.Action(Mvc.Leads.GetAllLeads())"
   var url2 = "@Url.Action(Mvc.Leads.Actions.GetAllLeads())"

They both appear to generate the same Url. Why the actions property?

回答1:

In short, no. The Actions property is there for backward compat with a really early version of T4MVC. But it may be better to yank it altogether now to avoid confusion.