ASP.NET Core MetaDataType Attribute not working

后端 未结 4 1835
遥遥无期
遥遥无期 2020-11-29 10:09

I\'m using the MetaDataType Attribute on my domain model class. It it supposed to move the attribute information from the referenced class into the class that the MetadataTy

4条回答
  •  感动是毒
    2020-11-29 10:30

    ASP.NET Core uses

    Microsoft.AspNetCore.Mvc **ModelMetadataType** 
    

    instead of

    System.ComponentModel.DataAnnotations.**MetadataType** 
    

    source

    Try changing your attribute to [ModelMetadataType(typeof(ComponentModelMetaData))]

提交回复
热议问题