Show / Hide Table of Contents

Class Context

A base implementation for contexts.

Inheritance
System.Object
System.Dynamic.DynamicObject
ExpandoBase
Expando
Context
AppContext
CompositionRegistrationContext
CodeConversionContext
EncryptionContext
HashingContext
ClientQueryExecutionContext
DataConversionContext
DataContextBase
DataContextConfiguration
DataOperationContext
DataSpace
DataIOContext
DataSetupContext
CodeGenerationContext
MessagingContext
ModelConstructionContext
ScriptingContext
AuthenticationContext
AuthorizationContext
SerializationContext
ServiceBehaviorContext<TServiceContract>
HostConfigurationContext
ActivityContext
Implements
IContext
IExpando
System.Dynamic.IDynamicMetaObjectProvider
IIndexable
ILoggable
System.IDisposable
Inherited Members
ExpandoBase.Item[String]
ExpandoBase.GetDynamicMemberNames()
ExpandoBase.HasDynamicMember(String)
ExpandoBase.TryGetMember(GetMemberBinder, Object)
ExpandoBase.TrySetMember(SetMemberBinder, Object)
ExpandoBase.TryInvokeMember(InvokeMemberBinder, Object[], Object)
ExpandoBase.ToDictionary(Func<String, String>, Func<Object, Object>)
ExpandoBase.GetInnerObjectTypeInfo()
ExpandoBase.GetThisTypeInfo()
ExpandoBase.TryGetValue(String, Object)
ExpandoBase.TrySetValue(String, Object)
System.Dynamic.DynamicObject.GetMetaObject(System.Linq.Expressions.Expression)
System.Dynamic.DynamicObject.TryBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Object, System.Object)
System.Dynamic.DynamicObject.TryConvert(System.Dynamic.ConvertBinder, System.Object)
System.Dynamic.DynamicObject.TryCreateInstance(System.Dynamic.CreateInstanceBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryDeleteIndex(System.Dynamic.DeleteIndexBinder, System.Object[])
System.Dynamic.DynamicObject.TryDeleteMember(System.Dynamic.DeleteMemberBinder)
System.Dynamic.DynamicObject.TryGetIndex(System.Dynamic.GetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TrySetIndex(System.Dynamic.SetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryUnaryOperation(System.Dynamic.UnaryOperationBinder, System.Object)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Services
Assembly: Kephas.Core.dll
Syntax
public class Context : Expando, IContext, IExpando, IDynamicMetaObjectProvider, IIndexable, ILoggable, IDisposable

Constructors

| Improve this Doc View Source

Context()

Initializes a new instance of the Context class.

Declaration
[Obsolete("In the near future it will be allowed only to pass a composition context to the context constructor.")]
protected Context()
| Improve this Doc View Source

Context(ICompositionContext, Boolean)

Initializes a new instance of the Context class.

Declaration
public Context(ICompositionContext compositionContext, bool isThreadSafe = false)
Parameters
Type Name Description
ICompositionContext compositionContext

The context for the composition (optional). If not provided, AmbientServices.Instance.CompositionContainer will be considered.

System.Boolean isThreadSafe

true if this object is thread safe when working with the internal dictionary, false otherwise. Default is false.

| Improve this Doc View Source

Context(IAmbientServices, Boolean)

Initializes a new instance of the Context class.

Declaration
public Context(IAmbientServices ambientServices, bool isThreadSafe = false)
Parameters
Type Name Description
IAmbientServices ambientServices

The ambient services.

System.Boolean isThreadSafe

true if this object is thread safe when working with the internal dictionary, false otherwise. Default is false.

| Improve this Doc View Source

Context(IContext, Boolean, Boolean)

Initializes a new instance of the Context class.

Declaration
public Context(IContext parentContext, bool isThreadSafe = false, bool merge = false)
Parameters
Type Name Description
IContext parentContext

The parent context.

System.Boolean isThreadSafe

Optional. true if this object is thread safe when working with the internal dictionary, false otherwise. Default is false.

System.Boolean merge

Optional. True to merge the parent context into the new context.

Properties

| Improve this Doc View Source

AmbientServices

Gets the ambient services.

Declaration
public IAmbientServices AmbientServices { get; }
Property Value
Type Description
IAmbientServices
| Improve this Doc View Source

CompositionContext

Gets the dependency injection/composition context.

Declaration
public ICompositionContext CompositionContext { get; }
Property Value
Type Description
ICompositionContext
| Improve this Doc View Source

Identity

Gets or sets the authenticated user.

Declaration
public IIdentity Identity { get; set; }
Property Value
Type Description
System.Security.Principal.IIdentity
| Improve this Doc View Source

Logger

Gets or sets the context logger.

Declaration
public ILogger Logger { get; set; }
Property Value
Type Description
ILogger

The context logger.

Methods

| Improve this Doc View Source

Dispose()

Releases the unmanaged resources used by the Kephas.Services.Context and optionally releases the managed resources.

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Releases the unmanaged resources used by the Kephas.Services.Context and optionally releases the managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

True to release both managed and unmanaged resources; false to release only unmanaged resources.

| Improve this Doc View Source

SetAmbientServices(IAmbientServices)

Sets ambient services.

Declaration
protected virtual void SetAmbientServices(IAmbientServices ambientServices)
Parameters
Type Name Description
IAmbientServices ambientServices

The ambient services (optional). If not provided, AmbientServices.Instance will be considered.

Remarks

The composition context is also set as the one exposed by the ambient services.

| Improve this Doc View Source

SetCompositionContext(ICompositionContext)

Sets composition context.

Declaration
protected virtual void SetCompositionContext(ICompositionContext compositionContext)
Parameters
Type Name Description
ICompositionContext compositionContext

The context for the composition (optional). If not provided, AmbientServices.Instance.CompositionContainer will be considered.

| Improve this Doc View Source

ValidateIdentity(IIdentity, IIdentity)

Validates the identity before changing it.

Declaration
protected virtual bool ValidateIdentity(IIdentity currentValue, IIdentity newValue)
Parameters
Type Name Description
System.Security.Principal.IIdentity currentValue

The current value.

System.Security.Principal.IIdentity newValue

The new value.

Returns
Type Description
System.Boolean

True if validation succeeds, false if it fails.

Implements

IContext
IExpando
System.Dynamic.IDynamicMetaObjectProvider
IIndexable
ILoggable
System.IDisposable

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
ExpandoExtensions.Merge<T>(T, Object)
ExpandoExtensions.GetLaxValue<T>(IIndexable, String, T)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
ContextExtensions.WithIdentity<TContext>(TContext, IIdentity)
ContextExtensions.WithLogger<TContext>(TContext, ILogger)
ContextExtensions.AddResource<TContext>(TContext, IDisposable[])
MessageBrokerExtensions.CreateBrokeredMessageBuilder(IContext)
ContextExtensions.InitialData(IContext)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<(Object entity, ChangeState changeState)>)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<Object>)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<IChangeStateTrackableEntityEntry>)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX