Beispiel #1
0
 public OeAttributeReader(OeModelBoundSettingsBuilder modelBoundSettingsBuilder)
 {
     _modelBoundSettingsBuilder = modelBoundSettingsBuilder;
     _modelBoundKind            = GetModelBoundKind();
 }
Beispiel #2
0
 public SelectExpandType?GetPropertySetting(IEdmProperty property, OeModelBoundKind modelBoundKind)
 {
     if (_properties.TryGetValue(property, out SelectExpandType?[] propertySettings))
Beispiel #3
0
        public bool IsAllowed(OeModelBoundProvider modelBoundProvider, IEdmProperty property, OeModelBoundKind modelBoundKind)
        {
            SelectExpandType?propertySetting = GetPropertySetting(property, modelBoundKind);

            if (propertySetting != null)
            {
                return(propertySetting.Value != SelectExpandType.Disabled);
            }

            if (NavigationProperty != null)
            {
                OeModelBoundSettings entitySettings = modelBoundProvider.GetSettings((IEdmEntityType)property.DeclaringType);
                if (entitySettings != null && entitySettings.GetPropertySetting(property, modelBoundKind) == SelectExpandType.Disabled)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #4
0
        private bool IsAllowed(IEdmProperty property, OeModelBoundSettings entitySettings, OeModelBoundKind modelBoundKind)
        {
            if (entitySettings == null)
            {
                entitySettings = GetSettings((IEdmEntityType)property.DeclaringType);
                if (entitySettings == null)
                {
                    return(true);
                }
            }

            return(entitySettings.IsAllowed(this, property, modelBoundKind));
        }
Beispiel #5
0
 private void SetPropertySetting(IEdmProperty property, OeModelBoundKind modelBoundKind, SelectExpandType allowed, IEdmNavigationProperty navigationProperty)
 {
     GetSettingsOrAdd(navigationProperty).SetPropertySetting(property, modelBoundKind, allowed);
 }
Beispiel #6
0
        private void SetPropertySetting(IEdmProperty property, OeModelBoundKind modelBoundKind, SelectExpandType allowed)
        {
            var entityType = (IEdmEntityType)property.DeclaringType;

            GetSettingsOrAdd(entityType).SetPropertySetting(property, modelBoundKind, allowed);
        }