dotnet/aspnetcore

Add support for TypeConverter on propertes/parameters in MVC

Open

#8 857 ouverte le 27 mars 2019

Voir sur GitHub
 (9 commentaires) (4 réactions) (0 assignés)C# (10 653 forks)batch import
affected-fewarea-mvcenhancementfeature-model-bindinghelp wantedseverity-minor

Métriques du dépôt

Stars
 (37 933 stars)
Métriques de merge PR
 (Merge moyen 16j 9h) (258 PRs mergées en 30 j)

Description

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.

Guide contributeur