Table of Contents

Class ListPayloadCache

Namespace
MassTransit.Payloads
Assembly
MassTransit.Abstractions.dll
public class ListPayloadCache : IPayloadCache
Inheritance
ListPayloadCache
Implements
Inherited Members

Constructors

ListPayloadCache()

public ListPayloadCache()

ListPayloadCache(object[])

public ListPayloadCache(object[] payloads)

Parameters

payloads object[]

Methods

AddOrUpdatePayload<T>(PayloadFactory<T>, UpdatePayloadFactory<T>)

Either adds a new payload, or updates an existing payload

public T AddOrUpdatePayload<T>(PayloadFactory<T> addFactory, UpdatePayloadFactory<T> updateFactory) where T : class

Parameters

addFactory PayloadFactory<T>

The payload factory called if the payload is not present

updateFactory UpdatePayloadFactory<T>

The payload factory called if the payload already exists

Returns

T

Type Parameters

T

The payload type

GetOrAddPayload<T>(PayloadFactory<T>)

Return an existing or create a new property

public T GetOrAddPayload<T>(PayloadFactory<T> payloadFactory) where T : class

Parameters

payloadFactory PayloadFactory<T>

Returns

T

Type Parameters

T

HasPayloadType(Type)

Checks if the property exists in the cache

public bool HasPayloadType(Type payloadType)

Parameters

payloadType Type

The property type

Returns

bool

True if the property exists in the cache, otherwise false

TryGetPayload<TPayload>(out TPayload?)

Returns the value of the property if it exists in the cache

public bool TryGetPayload<TPayload>(out TPayload? payload) where TPayload : class

Parameters

payload TPayload

The property value

Returns

bool

True if the value was returned, otherwise false

Type Parameters

TPayload

The property type