Beispiel #1
0
        protected override void OnInitialized()
        {
            Css = (string)AdditionalAttributes.GetValueOrDefault("class");

            var expression = (MemberExpression)For.Body;

            IsRequired = expression.Member.GetCustomAttribute <RequiredAttribute>() != null ? true : false;

            var displayNameAttribute = expression.Member.GetCustomAttribute <DisplayAttribute>();

            DisplayName = displayNameAttribute != null ? displayNameAttribute.Name : expression.Member.Name;
        }