Non constant attributes parameters?
Given my previous post Simple maths can boost your app performance did some more thoughts over it in this post .Net compiler says no!! An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type public class CustomAttribute : Attribute { public CriteriaOperator CriteriaOperator { get ; set ; } public CustomAttribute( CriteriaOperator criteriaOperator) { CriteriaOperator = criteriaOperator; } } [ CustomAttribute ( CriteriaOperator .Parse( "Name=?" , "eXpand" ))] public class Class1 { } the above cannot be compiled BUT XAF SAYS YES Why?
Διαβάστε περισσότερα »