Strongly-typed T4MVC Action/ActionLink

后端 未结 2 1140
天命终不由人
天命终不由人 2021-02-04 04:33

I\'ve been using T4MVC (FYI: v2.6.62) for quite some time, and I\'ve been slowly moving over our code to this way of working (less reliance on magic strings).

But I\'ve

2条回答
  •  情歌与酒
    2021-02-04 05:17

    Update (10/11/2012): the recently added support for Model Unbinders (see section 3.1 in the doc) should hopefully cover a lot of these cases.

    Original answer:

    Copying my reply from the forum thread:

    Hmmm, I don't think this has come up yet. Maybe in most cases that people have Action methods that take an object, the object's values come from posted form data, rather than being passed on the URL? In such scenario, the question doesn't arise.

    I think in theory T4MVC could be changed to support this. It would just need to promote all the object's top level properties as route values rather than try to use the object itself (obviously, the current behavior is bogus, and is a result of just calling ToString() blindly).

    Have others run into this and think it's worth addressing?

提交回复
热议问题