我正在使用 MVC 制作表单并使用[ControlType]For([expression])辅助方法(EG Html.TextBoxFor(...))
要将数据绑定到我使用以下 ViewModel 的控件:
public class UserViewModel
{
    //The Model that will be used to bind data to the elements
    public UserModel User { get; set; }
    //Used to bind selectable options to DropDownLists
    public SelectList DescentTypes { get; set; }
    public SelectList GenderTypes { get; set; }
}
使用它时,控件的名称设置为name="Property.SubProperty"(EG name="User.Id"),但我希望它显示name="Id"在我的 html 表单上。
是否可以在不必编写大量自定义代码的情况下做到这一点,以便框架可以将其转换回 ViewModel (UserViewModel) 或只是 Model (User) 本身?