/// <summary> /// Sets the EnableCount of <see cref="DefaultQuerySettings"/> in the configuration, /// depends on <see cref="QueryOptionSetting"/>. /// </summary> public static HttpConfiguration Count(this HttpConfiguration configuration, QueryOptionSetting setting) { DefaultQuerySettings defaultQuerySettings = configuration.GetDefaultQuerySettings(); defaultQuerySettings.EnableCount = setting == QueryOptionSetting.Allowed; return(configuration); }
public PropertyConfiguration <TEntity> OrderBy(QueryOptionSetting setting) { var navigationProperty = (IEdmNavigationProperty)_edmProperty; _modelBuilder.ModelBoundSettingsBuilder.SetOrderBy(_edmProperty, setting == QueryOptionSetting.Allowed, navigationProperty); return(this); }
public EntityTypeConfiguration <TEntity> OrderBy(QueryOptionSetting setting) { foreach (IEdmProperty edmProperty in _entityType.Properties()) { _modelBuilder.ModelBoundSettingsBuilder.SetOrderBy(edmProperty, setting == QueryOptionSetting.Allowed); } return(this); }
public EntityTypeConfiguration <TEntity> OrderBy(QueryOptionSetting setting, params String[] propertyNames) { foreach (String propertyName in propertyNames) { IEdmProperty edmProperty = _entityType.GetPropertyIgnoreCase(propertyName); _modelBuilder.ModelBoundSettingsBuilder.SetOrderBy(edmProperty, setting == QueryOptionSetting.Allowed); } return(this); }
/// <summary> /// Sets the EnableExpand of <see cref="DefaultQuerySettings"/> in route builder, /// depends on <see cref="QueryOptionSetting"/>. /// Todo: change QueryOptionSetting to SelectExpandType. /// </summary> public static IRouteBuilder Expand(this IRouteBuilder builder, QueryOptionSetting setting) { if (builder == null) { throw Error.ArgumentNull("builder"); } builder.ServiceProvider.Expand(setting); return(builder); }
public static void Select(this IServiceProvider serviceProvider, QueryOptionSetting setting) { if (serviceProvider == null) { throw Error.ArgumentNull(nameof(serviceProvider)); } DefaultQuerySettings defaultQuerySettings = serviceProvider.GetDefaultQuerySettings(); defaultQuerySettings.EnableSelect = setting == QueryOptionSetting.Allowed; }
public static void Expand(this IServiceProvider serviceProvider, QueryOptionSetting setting) { if (serviceProvider == null) { throw Error.ArgumentNull("serviceProvider"); } DefaultQuerySettings defaultQuerySettings = serviceProvider.GetDefaultQuerySettings(); defaultQuerySettings.EnableExpand = setting == QueryOptionSetting.Allowed; }
public PropertyConfiguration <TEntity> OrderBy(QueryOptionSetting setting, params String[] propertyNames) { var navigationProperty = (IEdmNavigationProperty)_edmProperty; IEdmEntityType entityType = navigationProperty.ToEntityType(); foreach (String propertyName in propertyNames) { IEdmProperty edmProperty = entityType.GetPropertyIgnoreCase(propertyName); _modelBuilder.ModelBoundSettingsBuilder.SetOrderBy(edmProperty, setting == QueryOptionSetting.Allowed, navigationProperty); } return(this); }
/// <summary> /// Sets the EnableCount of <see cref="DefaultQuerySettings"/> in route builder, /// depends on <see cref="QueryOptionSetting"/>. /// </summary> public static IRouteBuilder Count(this IRouteBuilder builder, QueryOptionSetting setting) { if (builder == null) { throw Error.ArgumentNull("builder"); } DefaultQuerySettings defaultQuerySettings = builder.GetDefaultQuerySettings(); defaultQuerySettings.EnableCount = setting == QueryOptionSetting.Allowed; return(builder); }
/// <summary> /// Sets whether all properties of this property is filterable. /// </summary> public PropertyConfiguration Filter(QueryOptionSetting setting) { QueryConfiguration.SetFilter(null, setting == QueryOptionSetting.Allowed); return(this); }
/// <summary> /// Sets filterable properties depends on <see cref="QueryOptionSetting"/> of this property. /// </summary> public PropertyConfiguration Filter(QueryOptionSetting setting, params string[] properties) { QueryConfiguration.SetFilter(properties, setting == QueryOptionSetting.Allowed); return(this); }
/// <summary> /// Sets whether all properties of this property is sortable. /// </summary> public PropertyConfiguration OrderBy(QueryOptionSetting setting) { QueryConfiguration.SetOrderBy(null, setting == QueryOptionSetting.Allowed); return(this); }
/// <summary> /// Sets whether this property is countable. /// </summary> public PropertyConfiguration Count(QueryOptionSetting queryOptionSetting) { QueryConfiguration.SetCount(queryOptionSetting == QueryOptionSetting.Allowed); return(this); }
/// <summary> /// Sets whether this property is countable of this structural type. /// </summary> public StructuralTypeConfiguration <TStructuralType> Count(QueryOptionSetting setting) { _configuration.QueryConfiguration.SetCount(setting == QueryOptionSetting.Allowed); _configuration.AddedExplicitly = true; return(this); }
/// <summary> /// Sets whether all properties of this structural type is sortable. /// </summary> public StructuralTypeConfiguration <TStructuralType> OrderBy(QueryOptionSetting setting) { _configuration.QueryConfiguration.SetOrderBy(null, setting == QueryOptionSetting.Allowed); _configuration.AddedExplicitly = true; return(this); }
/// <summary> /// Sets the EnableSkipToken to true of <see cref="DefaultQuerySettings"/> in route builder. /// </summary> public static IEndpointRouteBuilder SkipToken(this IEndpointRouteBuilder builder, QueryOptionSetting setting) { if (builder == null) { throw Error.ArgumentNull("builder"); } builder.ServiceProvider.SkipToken(setting); return(builder); }
public EntityTypeConfiguration <TEntity> Count(QueryOptionSetting setting) { _modelBuilder.ModelBoundSettingsBuilder.SetCount(setting == QueryOptionSetting.Allowed, _entityType); return(this); }
/// <summary> /// Sets filterable properties depends on <see cref="QueryOptionSetting"/> of this structural type. /// </summary> public StructuralTypeConfiguration <TStructuralType> Filter(QueryOptionSetting setting, params string[] properties) { this._configuration.QueryConfiguration.SetFilter(properties, setting == QueryOptionSetting.Allowed); this._configuration.AddedExplicitly = true; return(this); }
/// <summary> /// Sets whether all properties of this structural type is filterable. /// </summary> public StructuralTypeConfiguration <TStructuralType> Filter(QueryOptionSetting setting) { this._configuration.QueryConfiguration.SetFilter(null, setting == QueryOptionSetting.Allowed); this._configuration.AddedExplicitly = true; return(this); }
/// <summary> /// Sets sortable properties depends on <see cref="QueryOptionSetting"/> of this property. /// </summary> public PropertyConfiguration OrderBy(QueryOptionSetting setting, params string[] properties) { this.QueryConfiguration.SetOrderBy(properties, setting == QueryOptionSetting.Allowed); return(this); }