public async Task <AttachedAttrData> GetAttachedAttribute(IAttachedProperty <IAttr> attr) { var plainAttr = await attr.GetProperty(); var required = await attr.IsRequired(); var cardinality = await attr.GetCardinality(); var mutable = await attr.GetMutability(); var permission = await attr.GetPermission(); var provider = await GetProvider(attr.AttachmentID); var attrData = await AttrData.Instantiate(plainAttr); var defaultValue = await attr.GetDefaultValue(); IBoxedValue boxedDefaultValue = null; if (null != defaultValue) { var shownValue = attrData.Values.Where(a => a.EventID.ToString() == defaultValue).SingleOrDefault(); boxedDefaultValue = new BoxedValueData(defaultValue, shownValue?.Value ?? defaultValue); } return(new AttachedAttrData(attrData, required, cardinality, mutable, permission, boxedDefaultValue, provider, attr.Conditions, attr.AttachmentID)); }
public async Task <AttachedRelationData> GetAttachedRelation(IAttachedProperty <IRelation> relation) { var plainRelation = await relation.GetProperty(); var required = await relation.IsRequired(); var cardinality = await relation.GetCardinality(); var mutable = await relation.GetMutability(); var permission = await relation.GetPermission(); var provider = await GetProvider(relation.AttachmentID); return(new AttachedRelationData(plainRelation, required, cardinality, mutable, permission, provider, relation.Conditions, relation.AttachmentID)); }