ASP.NET Core MetaDataType Attribute not working

后端 未结 4 1796
遥遥无期
遥遥无期 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:37

    Another way... use same namespace

    public class ApirolesMetaData
    {
        [Required]
        public string Name { get; set; }
    }
    
    
    [ModelMetadataType(typeof(ApirolesMetaData))]
    public partial class Apiroles
    {
    
    }
    

提交回复
热议问题