Is this a bug with C# records and DataAnnotation? Can't get [Required] attribute to work without nasty hack

后端 未结 0 1298
温柔的废话
温柔的废话 2021-01-18 02:48

This code will pass, and shouldn\'t.

public record EmptyString([Required]string Name);
var context = new ValidationContext(src, null, null);

var es = new Emp         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题