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); }
private void AddMetadata(ValidationAttribute attribute) { _metadata.AddMetadata(_memberName, attribute); }
/// <summary> /// Indicates that an association references entities belonging to an external DomainContext. /// </summary> public void ExternalReference() { _metadata.AddMetadata(MemberName, new ExternalReferenceAttribute()); }
private void AddMetadata(ValidationAttribute attribute) { _metadata.AddMetadata(attribute); }
/// <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); }