dotnet/aspnetcore

Add support for TypeConverter on propertes/parameters in MVC

Open

#8,857 建立於 2019年3月27日

在 GitHub 查看
 (9 留言) (4 反應) (0 負責人)C# (10,653 fork)batch import
affected-fewarea-mvcenhancementfeature-model-bindinghelp wantedseverity-minor

倉庫指標

Star
 (37,933 star)
PR 合併指標
 (平均合併 16天 9小時) (30 天內合併 258 個 PR)

描述

Discussed here originally: https://github.com/aspnet/AspNetCore/issues/8846

This is a really simple way to implement model binding behaviour, and is a totally appropriate thing to do when you have a single field in the request that maps to a complex object.

It would be easy for us to support this because we already have infrastructure that users model binding to call a type converter. We already use type converters defined on types, what this would add would be the ability to use types like List<> and apply the attribute to provide a converter.

貢獻者指南