Table of Contents

Class ConstantContextDataProvider

Namespace
Styra.Opa.AspNetCore
Assembly
Styra.Opa.AspNetCore.dll

This helper class allows creating a ContextDataProvider which always returns the same constant value. This is useful for tests, and also for situations where the extra data to inject does not change during runtime.

public class ConstantContextDataProvider : IContextDataProvider
Inheritance
ConstantContextDataProvider
Implements
Inherited Members

Constructors

ConstantContextDataProvider(object)

public ConstantContextDataProvider(object newData)

Parameters

newData object

Methods

GetContextData(HttpContext)

public object GetContextData(HttpContext context)

Parameters

context HttpContext

Returns

object