Esempio n. 1
0
        private DisplayAttribute GetDisplayAttribute()
        {
            DisplayAttribute displayAttribute = null;

            List <Attribute> attributes = _metadata.GetMemberMetadata(_memberName);

            if (attributes != null)
            {
                displayAttribute = attributes.OfType <DisplayAttribute>().FirstOrDefault();
            }

            if (displayAttribute == null)
            {
                displayAttribute = new DisplayAttribute();
                _metadata.AddMetadata(_memberName, displayAttribute);
            }

            return(displayAttribute);
        }
Esempio n. 2
0
 private void AddMetadata(ValidationAttribute attribute)
 {
     _metadata.AddMetadata(attribute);
 }
 private void AddMetadata(ValidationAttribute attribute)
 {
     _metadata.AddMetadata(_memberName, attribute);
 }
Esempio n. 4
0
 /// <summary>
 /// Indicates that an association references entities belonging to an external DomainContext.
 /// </summary>
 public void ExternalReference()
 {
     _metadata.AddMetadata(MemberName, new ExternalReferenceAttribute());
 }
Esempio n. 5
0
 /// <summary>
 /// Indicates that an association references entities belonging to an external DomainContext.
 /// </summary>
 public AssociationMetadata <TEntity, TMember> IsExternalReference()
 {
     metadata.AddMetadata(member, new ExternalReferenceAttribute());
     return(this);
 }