Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration

Summary

Configuration for enabling/disabling specific features.

Remarks

Feature flags allow selective enabling of functionality for gradual rollouts, A/B testing, or environment-specific configurations without code changes.

Constructors

.ctor

Initializes a new instance of the FeatureFlagsConfiguration class.

Syntax

public FeatureFlagsConfiguration()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

CustomFlags

Gets or sets custom feature flag values.

Syntax

public System.Collections.Generic.Dictionary<string, bool> CustomFlags { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, bool> A dictionary of custom feature flag names and their enabled status.

Remarks

Custom feature flags allow applications to define their own toggleable features beyond the predefined flags in this configuration.

EnableAdvancedQuerying

Gets or sets a value indicating whether advanced querying features are enabled.

Syntax

public bool EnableAdvancedQuerying { get; set; }

Property Value

Type: bool true to enable advanced querying; otherwise, false.

Remarks

Advanced querying includes features like complex filterexpressions,customfunctions,andsophisticatedfilter expressions, custom functions, and sophisticated expand operations.

EnableAsyncStreaming

Gets or sets a value indicating whether async streaming is enabled.

Syntax

public bool EnableAsyncStreaming { get; set; }

Property Value

Type: bool true to enable async streaming; otherwise, false.

Remarks

Async streaming allows large result sets to be returned incrementally, improving perceived performance and reducing memory usage.

EnableBatchOperations

Gets or sets a value indicating whether batch operations are enabled.

Syntax

public bool EnableBatchOperations { get; set; }

Property Value

Type: bool true to enable batch operations; otherwise, false.

Remarks

Batch operations allow multiple operations to be executed in a single request, improving performance but increasing complexity and resource usage.

EnableBetaApiVersions

Gets or sets a value indicating whether beta API versions are enabled.

Syntax

public bool EnableBetaApiVersions { get; set; }

Property Value

Type: bool true to enable beta API versions; otherwise, false.

Remarks

Beta API versions provide access to new functionality before it becomes generally available, but may be unstable or subject to breaking changes.

EnableCachingOptimizations

Gets or sets a value indicating whether caching optimizations are enabled.

Syntax

public bool EnableCachingOptimizations { get; set; }

Property Value

Type: bool true to enable caching optimizations; otherwise, false.

Remarks

Caching optimizations include aggressive caching strategies that may improve performance at the cost of data freshness.

EnableCustomToolExtensions

Gets or sets a value indicating whether custom tool extensions are enabled.

Syntax

public bool EnableCustomToolExtensions { get; set; }

Property Value

Type: bool true to enable custom tool extensions; otherwise, false.

Remarks

Custom tool extensions allow loading additional MCP tools from external assemblies or configuration, extending the server’s capabilities.

EnableDevelopmentEndpoints

Gets or sets a value indicating whether development endpoints are enabled.

Syntax

public bool EnableDevelopmentEndpoints { get; set; }

Property Value

Type: bool true to enable development-specific endpoints; otherwise, false.

Remarks

Development endpoints include features like detailed diagnostics, configuration inspection, and testing utilities that should not be available in production.

EnableEnhancedSecurity

Gets or sets a value indicating whether enhanced security features are enabled.

Syntax

public bool EnableEnhancedSecurity { get; set; }

Property Value

Type: bool true to enable enhanced security; otherwise, false.

Remarks

Enhanced security features provide additional protection mechanisms that may impact performance or compatibility with some clients.

EnableExperimentalFeatures

Gets or sets a value indicating whether experimental features are enabled.

Syntax

public bool EnableExperimentalFeatures { get; set; }

Property Value

Type: bool true to enable experimental features; otherwise, false.

Remarks

Experimental features are new or unstable functionality that may change or be removed in future versions. Use with caution in production.

EnableLegacyCompatibility

Gets or sets a value indicating whether legacy compatibility mode is enabled.

Syntax

public bool EnableLegacyCompatibility { get; set; }

Property Value

Type: bool true to enable legacy compatibility; otherwise, false.

Remarks

Legacy compatibility mode maintains backward compatibility with older OData versions or non-standard implementations at the cost of modern features.

EnablePerformanceProfiling

Gets or sets a value indicating whether performance profiling is enabled.

Syntax

public bool EnablePerformanceProfiling { get; set; }

Property Value

Type: bool true to enable performance profiling; otherwise, false.

Remarks

Performance profiling collects detailed timing and resource usage information for optimization purposes but adds overhead to request processing.

EnforceStrictSchemaValidation

Gets or sets a value indicating whether schema validation is enforced.

Syntax

public bool EnforceStrictSchemaValidation { get; set; }

Property Value

Type: bool true to enforce strict schema validation; otherwise, false.

Remarks

Strict schema validation ensures all requests conform exactly to the OData schema but may reject valid requests with minor variations.

FlagMetadata

Gets or sets feature flag metadata.

Syntax

public System.Collections.Generic.Dictionary<string, object> FlagMetadata { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, object> A dictionary containing metadata about feature flags.

Remarks

Metadata can include information such as flag descriptions, deprecation notices, rollout percentages, or other contextual information.

Methods

AddFlagMetadata

Adds metadata for a feature flag.

Syntax

public void AddFlagMetadata(string flagName, object metadata)

Parameters

NameTypeDescription
flagNamestringThe name of the feature flag.
metadataobjectThe metadata object to associate with the flag.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when flagName is null or whitespace.

Clone

Creates a copy of this configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration Clone()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration A new instance with the same settings.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ForDevelopment

Creates a configuration optimized for development environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration ForDevelopment()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration A feature flags configuration suitable for development.

ForProduction

Creates a configuration optimized for production environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration ForProduction()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration A feature flags configuration suitable for production.

GetEnabledFlags

Gets all enabled feature flags.

Syntax

public System.Collections.Generic.IEnumerable<string> GetEnabledFlags()

Returns

Type: System.Collections.Generic.IEnumerable<string> A collection of enabled feature flag names.

GetFlagMetadata

Gets metadata for a feature flag.

Syntax

public T GetFlagMetadata<T>(string flagName)

Parameters

NameTypeDescription
flagNamestringThe name of the feature flag.

Returns

Type: T? The metadata object if found and of the correct type; otherwise, the default value.

Type Parameters

  • T - The type of the metadata object.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetStatistics

Gets feature flag statistics for monitoring and diagnostics.

Syntax

public System.Collections.Generic.Dictionary<string, object> GetStatistics()

Returns

Type: System.Collections.Generic.Dictionary<string, object> A dictionary containing feature flag statistics.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

IsEnabled

Determines whether a specific feature flag is enabled.

Syntax

public bool IsEnabled(string flagName)

Parameters

NameTypeDescription
flagNamestringThe name of the feature flag to check.

Returns

Type: bool true if the flag is enabled; otherwise, false.

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

MergeWith

Merges another configuration into this one, with the other configuration taking precedence.

Syntax

public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration other)

Parameters

NameTypeDescription
otherMicrosoft.OData.Mcp.Core.Configuration.FeatureFlagsConfigurationThe configuration to merge into this one.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when other is null.

Minimal

Creates a minimal configuration with most features disabled.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration Minimal()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration A feature flags configuration with minimal features enabled.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

RemoveCustomFlag

Removes a custom feature flag.

Syntax

public bool RemoveCustomFlag(string flagName)

Parameters

NameTypeDescription
flagNamestringThe name of the feature flag to remove.

Returns

Type: bool true if the flag was removed; otherwise, false.

SetCustomFlag

Sets the value of a custom feature flag.

Syntax

public void SetCustomFlag(string flagName, bool enabled)

Parameters

NameTypeDescription
flagNamestringThe name of the feature flag.
enabledboolWhether the flag should be enabled.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when flagName is null or whitespace.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

Validate

Validates the feature flags configuration.

Syntax

public System.Collections.Generic.IEnumerable<string> Validate()

Returns

Type: System.Collections.Generic.IEnumerable<string> A collection of validation warnings, or empty if the configuration is valid.

Remarks

Feature flags validation focuses on warnings rather than errors, as most combinations are valid but some may indicate misconfigurations.