Skip to content

Add support for MetadataTypeAttribute #40

@daniel-white

Description

@daniel-white

System.ComponentModel.DataAnnotations.MetadataTypeAttribute is a handy bridge to attributes defined in other files, especially in code generated files. It works with the validation frameworks. I don't see why it wouldn't here.

Example:

[GeneratedCode]
[MetadataTypeAttribute(typeof(DtoMetadata))]
public partial class Dto
{
    public string Private { get; set; }
}

internal class DtoMetadata
{
     [NotLogged]
     public object Private { get; set; }
}

I think it would be great if both sources could be utilized, but the configuration on the primary class would win in the event of a conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions