Beispiel #1
0
            private void WriteProperty(OdcmClass odcmClass, IEdmEntitySet entitySet)
            {
                var odcmType     = ResolveType(entitySet.EntityType().Name, entitySet.EntityType().Namespace);
                var odcmProperty = new OdcmEntitySet(entitySet.Name)
                {
                    Class        = odcmClass,
                    IsCollection = true,
                    IsLink       = true
                };

                odcmProperty.Projection = new OdcmProjection
                {
                    Type     = odcmType,
                    BackLink = odcmProperty
                };

                _propertyCapabilitiesCache.Add(odcmProperty, OdcmCapability.DefaultEntitySetCapabilities);

                AddVocabularyAnnotations(odcmProperty, entitySet);

                odcmClass.Properties.Add(odcmProperty);
            }
Beispiel #2
0
            private void WriteProperty(OdcmClass odcmClass, IEdmEntitySet entitySet)
            {
                try
                {
                    var navPropBindings = GetNavigationPropertyBindings(entitySet);
                    var odcmType        = ResolveType(entitySet.EntityType().Name, entitySet.EntityType().Namespace);
                    var odcmProperty    = new OdcmEntitySet(entitySet.Name, navPropBindings)
                    {
                        Class        = odcmClass,
                        IsCollection = true,
                        IsLink       = true
                    };

                    odcmProperty.Projection = new OdcmProjection
                    {
                        Type     = odcmType,
                        BackLink = odcmProperty
                    };

                    try
                    {
                        _propertyCapabilitiesCache.Add(odcmProperty, OdcmCapability.DefaultEntitySetCapabilities);
                    }
                    catch (InvalidOperationException e)
                    {
                        Logger.Warn("Failed to add property to cache", e);
                    }

                    AddVocabularyAnnotations(odcmProperty, entitySet);

                    odcmClass.Properties.Add(odcmProperty);
                }
                // If we hit an invalid type, skip this property
                catch (InvalidOperationException e)
                {
                    Logger.Error("Could not resolve type", e);
                }
            }