3
Pourquoi «décimal» n'est pas un type de paramètre d'attribut valide?
C'est vraiment incroyable mais réel. Ce code ne fonctionnera pas: [AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)] public class Range : Attribute { public decimal Max { get; set; } public decimal Min { get; set; } } public class Item { [Range(Min=0m,Max=1000m)] //compile error:'Min' is not a valid named attribute argument because it is not …
139
c#
.net
attributes