Table of Contents

Class EcsBuilderUseMiddlewareExtensions

Namespace
SampSharp.Entities
Assembly
SampSharp.OpenMp.Entities.dll

Provides extended functionality for configuring a IEcsBuilder instance.

public static class EcsBuilderUseMiddlewareExtensions
Inheritance
EcsBuilderUseMiddlewareExtensions
Inherited Members

Methods

UseMiddleware(IEcsBuilder, string, Func<EventContext, Func<object?>, object?>)

Adds a middleware to the handler of the event with the specified name.

public static IEcsBuilder UseMiddleware(this IEcsBuilder builder, string name, Func<EventContext, Func<object?>, object?> middleware)

Parameters

builder IEcsBuilder

The ECS builder to add the middleware to.

name string

The name of the event.

middleware Func<EventContext, Func<object>, object>

The middleware to add to the event.

Returns

IEcsBuilder

A reference to this instance after the operation has completed.

UseMiddleware(IEcsBuilder, string, Func<EventDelegate, EventDelegate>)

Adds a middleware to the handler of the event with the specified name.

public static IEcsBuilder UseMiddleware(this IEcsBuilder builder, string name, Func<EventDelegate, EventDelegate> middleware)

Parameters

builder IEcsBuilder

The ECS builder to add the middleware to.

name string

The name of the event.

middleware Func<EventDelegate, EventDelegate>

The middleware to add to the event.

Returns

IEcsBuilder

A reference to this instance after the operation has completed.

UseMiddleware(IEcsBuilder, string, Type, params object[])

Adds a middleware of the specified type middleware to the handler of the event with the specified name.

public static IEcsBuilder UseMiddleware(this IEcsBuilder builder, string name, Type middleware, params object[] args)

Parameters

builder IEcsBuilder

The ECS builder to add the middleware to.

name string

The name of the event.

middleware Type

The type of the middleware.

args object[]

The arguments for the constructor of the event.

Returns

IEcsBuilder

A reference to this instance after the operation has completed.

UseMiddleware<TMiddleware>(IEcsBuilder, string, params object[])

Adds a middleware of the specified type TMiddleware to the handler of the event with the specified name.

public static IEcsBuilder UseMiddleware<TMiddleware>(this IEcsBuilder builder, string name, params object[] args)

Parameters

builder IEcsBuilder

The ECS builder to add the middleware to.

name string

The name of the event.

args object[]

The arguments for the constructor of the event.

Returns

IEcsBuilder

A reference to this instance after the operation has completed.

Type Parameters

TMiddleware

The type of the middleware.