public PropertyConfiguration <TEntity> Select(SelectExpandType expandType)
        {
            var navigationProperty = (IEdmNavigationProperty)_edmProperty;

            _modelBuilder.ModelBoundSettingsBuilder.SetSelect(_edmProperty, expandType, navigationProperty);
            return(this);
        }
Beispiel #2
0
 /// <summary>
 /// Sets selectable properties depends on <see cref="SelectExpandType"/> of this structural type.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Select(SelectExpandType selectType,
                                                             params string[] properties)
 {
     this._configuration.QueryConfiguration.SetSelect(properties, selectType);
     this._configuration.AddedExplicitly = true;
     return(this);
 }
 public EntityTypeConfiguration <TEntity> Select(SelectExpandType expandType, params String[] propertyNames)
 {
     foreach (String propertyName in propertyNames)
     {
         IEdmProperty edmProperty = _entityType.GetPropertyIgnoreCase(propertyName);
         _modelBuilder.ModelBoundSettingsBuilder.SetSelect(edmProperty, expandType);
     }
     return(this);
 }
        public PropertyConfiguration <TEntity> Select(SelectExpandType expandType, params String[] propertyNames)
        {
            var            navigationProperty = (IEdmNavigationProperty)_edmProperty;
            IEdmEntityType entityType         = navigationProperty.ToEntityType();

            foreach (String propertyName in propertyNames)
            {
                IEdmProperty edmProperty = entityType.GetPropertyIgnoreCase(propertyName);
                _modelBuilder.ModelBoundSettingsBuilder.SetSelect(edmProperty, expandType, navigationProperty);
            }
            return(this);
        }
Beispiel #5
0
 /// <summary>
 /// Sets the SelectConfigurations in <see cref="ModelBoundQuerySettings"/>.
 /// </summary>
 public virtual void SetSelect(IEnumerable <string> properties, SelectExpandType selectType)
 {
     GetModelBoundQuerySettingsOrDefault();
     if (properties == null)
     {
         ModelBoundQuerySettings.DefaultSelectType = selectType;
     }
     else
     {
         foreach (var property in properties)
         {
             ModelBoundQuerySettings.SelectConfigurations[property] = selectType;
         }
     }
 }
Beispiel #6
0
        private void SetProperty(IEdmProperty edmProperty, SelectExpandType allowed, IEdmNavigationProperty navigationProperty)
        {
            switch (_modelBoundKind)
            {
            case OeModelBoundKind.Select:
                _modelBoundSettingsBuilder.SetSelect(edmProperty, allowed, navigationProperty);
                break;

            case OeModelBoundKind.Filter:
                _modelBoundSettingsBuilder.SetFilter(edmProperty, allowed != SelectExpandType.Disabled, navigationProperty);
                break;

            case OeModelBoundKind.OrderBy:
                _modelBoundSettingsBuilder.SetOrderBy(edmProperty, allowed != SelectExpandType.Disabled, navigationProperty);
                break;
            }
        }
Beispiel #7
0
 /// <summary>
 /// Sets the ExpandConfigurations in <see cref="ModelBoundQuerySettings"/>.
 /// </summary>
 public virtual void SetExpand(IEnumerable <string> properties, int?maxDepth, SelectExpandType expandType)
 {
     GetModelBoundQuerySettingsOrDefault();
     if (properties == null)
     {
         ModelBoundQuerySettings.DefaultExpandType = expandType;
         ModelBoundQuerySettings.DefaultMaxDepth   = maxDepth ?? ODataValidationSettings.DefaultMaxExpansionDepth;
     }
     else
     {
         foreach (var property in properties)
         {
             ModelBoundQuerySettings.ExpandConfigurations[property] = new ExpandConfiguration
             {
                 ExpandType = expandType,
                 MaxDepth   = maxDepth ?? ODataValidationSettings.DefaultMaxExpansionDepth
             };
         }
     }
 }
 public SelectAttribute(SelectExpandType selectExpandType)
 {
     SelectExpandType = selectExpandType;
 }
 public ExpandAttribute(SelectExpandType expandType)
 {
     _expandType          = expandType;
     ExpandConfigurations = new Dictionary <String, SelectExpandType>();
 }
Beispiel #10
0
 /// <summary>
 /// Sets the maximum depth of expand result,
 /// expandable properties and their <see cref="SelectExpandType"/> of this structural type.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Expand(int maxDepth, SelectExpandType expandType, params string[] properties)
 {
     this._configuration.QueryConfiguration.SetExpand(properties, maxDepth, expandType);
     this._configuration.AddedExplicitly = true;
     return(this);
 }
Beispiel #11
0
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties of this structural type.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Expand(SelectExpandType expandType)
 {
     this._configuration.QueryConfiguration.SetExpand(null, null, expandType);
     this._configuration.AddedExplicitly = true;
     return(this);
 }
Beispiel #12
0
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties with maximum depth of expand result.
 /// </summary>
 public PropertyConfiguration Expand(SelectExpandType expandType, int maxDepth)
 {
     QueryConfiguration.SetExpand(null, maxDepth, expandType);
     return(this);
 }
Beispiel #13
0
 private void SetPropertySetting(IEdmProperty property, OeModelBoundKind modelBoundKind, SelectExpandType allowed, IEdmNavigationProperty navigationProperty)
 {
     GetSettingsOrAdd(navigationProperty).SetPropertySetting(property, modelBoundKind, allowed);
 }
Beispiel #14
0
 /// <summary>
 /// Sets selectable properties depends on <see cref="SelectExpandType"/> of this property.
 /// </summary>
 public PropertyConfiguration Select(SelectExpandType selectType, params string[] properties)
 {
     QueryConfiguration.SetSelect(properties, selectType);
     return(this);
 }
Beispiel #15
0
 /// <summary>
 /// Sets the maximum depth of expand result,
 /// expandable properties and their <see cref="SelectExpandType"/> of this navigation property.
 /// </summary>
 public PropertyConfiguration Expand(int maxDepth, SelectExpandType expandType, params string[] properties)
 {
     QueryConfiguration.SetExpand(properties, maxDepth, expandType);
     return(this);
 }
Beispiel #16
0
 public ExpandAttribute(int maxDepth, SelectExpandType selectExpandType)
 {
     MaxDepth         = maxDepth;
     SelectExpandType = selectExpandType;
 }
 public PropertyConfiguration <TEntity> Expand(SelectExpandType expandType)
 {
     return(Select(expandType));
 }
Beispiel #18
0
 public void SetSelect(IEdmProperty property, SelectExpandType selectType)
 {
     SetPropertySetting(property, OeModelBoundKind.Select, selectType);
 }
 public SelectAttribute(SelectExpandType selectType)
 {
     _selectType          = selectType;
     SelectConfigurations = new Dictionary <String, SelectExpandType>();
 }
Beispiel #20
0
 public void SetSelect(IEdmProperty property, SelectExpandType selectType, IEdmNavigationProperty navigationProperty)
 {
     SetPropertySetting(property, OeModelBoundKind.Select, selectType, navigationProperty);
 }
Beispiel #21
0
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties of this property is selectable.
 /// </summary>
 public PropertyConfiguration Select(SelectExpandType selectType)
 {
     QueryConfiguration.SetSelect(null, selectType);
     return(this);
 }
 public EntityTypeConfiguration <TEntity> Expand(SelectExpandType expandType, params String[] propertyNames)
 {
     return(Select(expandType, propertyNames));
 }
Beispiel #23
0
 /// <summary>
 /// Sets the expandable properties and their <see cref="SelectExpandType"/> of this navigation property.
 /// </summary>
 public PropertyConfiguration Expand(SelectExpandType expandType, params string[] properties)
 {
     QueryConfiguration.SetExpand(properties, null, expandType);
     return(this);
 }
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties with maximum depth of expand result of this structural type.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Expand(SelectExpandType expandType, int maxDepth)
 {
     _configuration.QueryConfiguration.SetExpand(null, maxDepth, expandType);
     _configuration.AddedExplicitly = true;
     return(this);
 }
Beispiel #25
0
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties.
 /// </summary>
 public PropertyConfiguration Expand(SelectExpandType expandType)
 {
     QueryConfiguration.SetExpand(null, null, expandType);
     return(this);
 }
Beispiel #26
0
        private void SetPropertySetting(IEdmProperty property, OeModelBoundKind modelBoundKind, SelectExpandType allowed)
        {
            var entityType = (IEdmEntityType)property.DeclaringType;

            GetSettingsOrAdd(entityType).SetPropertySetting(property, modelBoundKind, allowed);
        }
Beispiel #27
0
 /// <summary>
 /// Sets <see cref="SelectExpandType"/> of all properties of this structural type is selectable.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Select(SelectExpandType selectType)
 {
     this._configuration.QueryConfiguration.SetSelect(null, selectType);
     this._configuration.AddedExplicitly = true;
     return(this);
 }
 /// <summary>
 /// Sets the expandable properties and their <see cref="SelectExpandType"/> of this structural type.
 /// </summary>
 public StructuralTypeConfiguration <TStructuralType> Expand(SelectExpandType expandType, params string[] properties)
 {
     _configuration.QueryConfiguration.SetExpand(properties, null, expandType);
     _configuration.AddedExplicitly = true;
     return(this);
 }