Interface IBindingWhenSyntax<T>
Used to define the conditions under which a binding should be used.
Inherited Members
Namespace: Telerik.JustMock.AutoMock.Ninject.Syntax
Assembly: Telerik.JustMock.dll
Syntax
public interface IBindingWhenSyntax<T> : IBindingSyntax, IHaveBindingConfiguration, IHaveKernel, IFluentSyntax
Type Parameters
T
The service being bound. |
Methods
When(Func<IRequest, Boolean>)
Indicates that the binding should be used only for requests that support the specified condition.
Declaration
IBindingInNamedWithOrOnSyntax<T> When(Func<IRequest, bool> condition)
Parameters
System.Func<IRequest, System.Boolean>
condition
The condition. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenAnyAncestorMatches(Predicate<IContext>)
Indicates that the binding should be used only when any ancestor matches the specified predicate.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenAnyAncestorMatches(Predicate<IContext> predicate)
Parameters
System.Predicate<IContext>
predicate
The predicate to match. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenAnyAncestorNamed(String)
Indicates that the binding should be used only when any ancestor is bound with the specified name.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenAnyAncestorNamed(string name)
Parameters
System.String
name
The name to expect. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenAnyAnchestorNamed(String)
Indicates that the binding should be used only when any ancestor is bound with the specified name.
Declaration
[Obsolete("Use WhenAnyAncestorNamed(string name)")]
IBindingInNamedWithOrOnSyntax<T> WhenAnyAnchestorNamed(string name)
Parameters
System.String
name
The name to expect. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenClassHas(Type)
Indicates that the binding should be used only when the class being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenClassHas(Type attributeType)
Parameters
System.Type
attributeType
The type of attribute. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenClassHas<TAttribute>()
Indicates that the binding should be used only when the class being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenClassHas<TAttribute>()
where TAttribute : Attribute
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
Type Parameters
TAttribute
The type of attribute. |
WhenInjectedExactlyInto(Type)
Indicates that the binding should be used only for injections on the specified type. The type must match exactly the specified type. Types that derive from the specified type will not be considered as valid target.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedExactlyInto(Type parent)
Parameters
System.Type
parent
The type. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenInjectedExactlyInto(Type[])
Indicates that the binding should be used only for injections on the specified type. The type must match one of the specified types exactly. Types that derive from one of the specified types will not be considered as valid target. Should match at least one of the specified targets
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedExactlyInto(params Type[] parents)
Parameters
System.Type[]
parents
The types. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenInjectedExactlyInto<TParent>()
Indicates that the binding should be used only for injections on the specified type. The type must match exactly the specified type. Types that derive from the specified type will not be considered as valid target.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedExactlyInto<TParent>()
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
Type Parameters
TParent
The type. |
WhenInjectedInto(Type)
Indicates that the binding should be used only for injections on the specified type. Types that derive from the specified type are considered as valid targets.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedInto(Type parent)
Parameters
System.Type
parent
The type. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenInjectedInto(Type[])
Indicates that the binding should be used only for injections on the specified types. Types that derive from one of the specified types are considered as valid targets. Should match at lease one of the targets.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedInto(params Type[] parents)
Parameters
System.Type[]
parents
The types to match. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenInjectedInto<TParent>()
Indicates that the binding should be used only for injections on the specified type. Types that derive from the specified type are considered as valid targets.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenInjectedInto<TParent>()
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
Type Parameters
TParent
The type. |
WhenMemberHas(Type)
Indicates that the binding should be used only when the member being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenMemberHas(Type attributeType)
Parameters
System.Type
attributeType
The type of attribute. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenMemberHas<TAttribute>()
Indicates that the binding should be used only when the member being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenMemberHas<TAttribute>()
where TAttribute : Attribute
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
Type Parameters
TAttribute
The type of attribute. |
WhenNoAncestorMatches(Predicate<IContext>)
Indicates that the binding should be used only when no ancestor matches the specified predicate.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenNoAncestorMatches(Predicate<IContext> predicate)
Parameters
System.Predicate<IContext>
predicate
The predicate to match. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenNoAncestorNamed(String)
Indicates that the binding should be used only when no ancestor is bound with the specified name.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenNoAncestorNamed(string name)
Parameters
System.String
name
The name to expect. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenParentNamed(String)
Indicates that the binding should be used only when the service is being requested by a service bound with the specified name.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenParentNamed(string name)
Parameters
System.String
name
The name to expect. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenTargetHas(Type)
Indicates that the binding should be used only when the target being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenTargetHas(Type attributeType)
Parameters
System.Type
attributeType
The type of attribute. |
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
WhenTargetHas<TAttribute>()
Indicates that the binding should be used only when the target being injected has an attribute of the specified type.
Declaration
IBindingInNamedWithOrOnSyntax<T> WhenTargetHas<TAttribute>()
where TAttribute : Attribute
Returns
IBindingInNamedWithOrOnSyntax<T>
The fluent syntax. |
Type Parameters
TAttribute
The type of attribute. |