public RelationMetadata GetRelationMetaData(string logicalName, string schemaName) { var key = $"MetaDataHelper.GetRelationMetaData|{logicalName}|{schemaName}"; var cachedEntityMetaData = GetFromMemCache <RelationMetadata>(key); if (cachedEntityMetaData != null) { return(cachedEntityMetaData); } var retrievedMetaData = MetadataHelpers.GetRelation(service, logicalName, schemaName, CrmService.OrgId); if (retrievedMetaData == null) { throw new Exception($"Couldn't find metadata for relation '{schemaName}' in entity '{logicalName}'."); } return(AddToMemCache(key, retrievedMetaData)); }