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.RateLimitingConfiguration

Summary

Configuration for request rate limiting and throttling.

Remarks

Rate limiting configuration controls how many requests clients can make within specific time windows. This helps protect the server from abuse, denial-of-service attacks, and ensures fair resource usage across clients.

Constructors

.ctor

Syntax

public RateLimitingConfiguration()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

BurstLimit

Gets or sets the burst limit for requests.

Syntax

public int BurstLimit { get; set; }

Property Value

Type: int The maximum number of requests allowed in a short burst.

Remarks

The burst limit allows clients to exceed the sustained rate temporarily, accommodating normal traffic spikes while still preventing abuse.

RequestsPerMinute

Gets or sets the maximum number of requests allowed per minute.

Syntax

public int RequestsPerMinute { get; set; }

Property Value

Type: int The maximum requests per minute per client.

Remarks

This sets the sustained rate limit for clients. Requests exceeding this rate will be throttled or rejected based on the rate limiting policy.

TimeWindow

Gets or sets the time window for rate limit calculations.

Syntax

public System.TimeSpan TimeWindow { get; set; }

Property Value

Type: System.TimeSpan The time window over which requests are counted.

Remarks

The time window defines the period over which the rate limit is enforced. Shorter windows provide more responsive protection but may be more sensitive to normal traffic variations.

Methods

Clone

Creates a copy of this rate limiting configuration.

Syntax

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

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration 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

ForProduction

Creates a rate limiting configuration optimized for production environments.

Syntax

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

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.RateLimitingConfiguration A rate limiting configuration suitable for production use.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

MergeWith

Merges another rate limiting configuration into this one.

Syntax

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

Parameters

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

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

Validate

Validates the rate limiting configuration.

Syntax

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

Returns

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