/// <summary> /// Gets property value. /// </summary> /// <param name="propertyName">Short name of the property to get. Eg. "Name"</param> /// <returns>String, Double, ValueId or IList<ValueId>.</returns> /// <exception cref="KeyNotFoundException">If no property found.</exception> public virtual object GetProperty(string propertyName) { if (propertyName == EffortProperty) { return(EntityContainer.GetEffort(this)); } var attribute = Asset.Attributes[TypePrefix + '.' + propertyName]; var allValues = GetPropertyValues(propertyName); if (attribute.Definition.IsMultiValue) { var currentValues = attribute.Values; return(allValues == null ? currentValues : allValues.Subset(attribute.Values)); } var value = attribute.Value; if (value is Oid) { return(allValues == null ? value : allValues.Find((Oid)value)); } return(value); }