Show / Hide Table of Contents

Class AppServiceContractAttribute

Marks an interface to be an application service contract. Application services are automatically identified by the composition and added to the container.

Inheritance
System.Object
System.Attribute
AppServiceContractAttribute
ScopedAppServiceContractAttribute
SingletonAppServiceContractAttribute
Implements
IAppServiceInfo
Inherited Members
System.Attribute.Equals(System.Object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.Match(System.Object)
System.Attribute.TypeId
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Kephas.Services
Assembly: Kephas.Core.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public class AppServiceContractAttribute : Attribute, IAppServiceInfo

Constructors

| Improve this Doc View Source

AppServiceContractAttribute()

Initializes a new instance of the AppServiceContractAttribute class.

Declaration
public AppServiceContractAttribute()
| Improve this Doc View Source

AppServiceContractAttribute(AppServiceLifetime)

Initializes a new instance of the AppServiceContractAttribute class.

Declaration
protected AppServiceContractAttribute(AppServiceLifetime lifetime)
Parameters
Type Name Description
AppServiceLifetime lifetime

The lifetime.

Fields

| Improve this Doc View Source

DefaultMetadataAttributeTypes

The default metadata attribute types.

Declaration
public static readonly IReadOnlyCollection<Type> DefaultMetadataAttributeTypes
Field Value
Type Description
System.Collections.Generic.IReadOnlyCollection<System.Type>
| Improve this Doc View Source

EmptyMetadataAttributeTypes

The empty metadata attribute types.

Declaration
public static readonly IReadOnlyCollection<Type> EmptyMetadataAttributeTypes
Field Value
Type Description
System.Collections.Generic.IReadOnlyCollection<System.Type>

Properties

| Improve this Doc View Source

AllowMultiple

Gets or sets a value indicating whether multiple services for this contract are allowed.

Declaration
public bool AllowMultiple { get; set; }
Property Value
Type Description
System.Boolean

true if multiple services are allowed; otherwise, false.

| Improve this Doc View Source

AsOpenGeneric

Gets or sets a value indicating whether the contract should be exported as an open generic.

Declaration
public bool AsOpenGeneric { get; set; }
Property Value
Type Description
System.Boolean

true if the contract should be exported as an open generic; otherwise, false.

| Improve this Doc View Source

ContractType

Gets or sets the contract type of the export.

Declaration
public Type ContractType { get; set; }
Property Value
Type Description
System.Type

The contract type of the export.

| Improve this Doc View Source

Lifetime

Gets the application service lifetime.

Declaration
public AppServiceLifetime Lifetime { get; }
Property Value
Type Description
AppServiceLifetime

The application service lifetime.

| Improve this Doc View Source

MetadataAttributes

Gets or sets the supported metadata attributes.

Declaration
public Type[] MetadataAttributes { get; set; }
Property Value
Type Description
System.Type[]

The metadata attributes.

Remarks

The metadata attributes are used to register the conventions for application services.

Methods

| Improve this Doc View Source

RegisterDefaultMetadataAttributeTypes(Type[])

Registers the provided metadata attribute types as default attributes.

Declaration
public static void RegisterDefaultMetadataAttributeTypes(params Type[] attributeTypes)
Parameters
Type Name Description
System.Type[] attributeTypes

A variable-length parameters list containing attribute types.

| Improve this Doc View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that represents the current object.

Overrides
System.Object.ToString()

Explicit Interface Implementations

| Improve this Doc View Source

IAppServiceInfo.Instance

Gets the service instance.

Declaration
object IAppServiceInfo.Instance { get; }
Returns
Type Description
System.Object

The service instance.

| Improve this Doc View Source

IAppServiceInfo.InstanceFactory

Gets the service instance factory.

Declaration
Func<ICompositionContext, object> IAppServiceInfo.InstanceFactory { get; }
Returns
Type Description
System.Func<ICompositionContext, System.Object>

The service instance factory.

| Improve this Doc View Source

IAppServiceInfo.InstanceType

Gets the type of the service instance.

Declaration
Type IAppServiceInfo.InstanceType { get; }
Returns
Type Description
System.Type

The type of the service instance.

Implements

IAppServiceInfo

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>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
AppServiceInfoExtensions.IsSingleton(IAppServiceInfo)
AppServiceInfoExtensions.IsScoped(IAppServiceInfo)
AppServiceInfoExtensions.IsTransient(IAppServiceInfo)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX