DependencyResolverExtensions

Name Value
Assembly Catel.Core
Namespace Catel.IoC
Available on .NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public static class DependencyResolverExtensions

Extensions for the IDependencyResolver.

Methods

CanResolve(IDependencyResolver dependencyResolver, object tag)

Determines whether the specified type with the specified tag can be resolved.

Type Parameters

T The type to resolve.

Parameters

Name Description
dependencyResolver The dependency resolver.
tag The tag.

Exceptions

Name Description
ArgumentNullException The dependencyResolver isnull.

Resolve(IDependencyResolver dependencyResolver, object tag)

Resolves the specified type with the specified tag.

Type Parameters

T Tye type to resolve.

Parameters

Name Description
dependencyResolver The dependency resolver.
tag The tag.

Returns

The resolved object.

Exceptions

Name Description
ArgumentNullException The dependencyResolver isnull.

TryResolve(IDependencyResolver dependencyResolver, Type serviceType, object tag)

Try to resolve the specified type with the specified tag.

Parameters

Name Description
dependencyResolver The dependency resolver.
serviceType Type of the service.
tag The tag.

Returns

The resolved object ornull if the type could not be resolved.

Exceptions

Name Description
ArgumentNullException The dependencyResolver isnull.

TryResolve(IDependencyResolver dependencyResolver, object tag)

Try to resolve the specified type with the specified tag.

Type Parameters

T The type to resolve.

Parameters

Name Description
dependencyResolver The dependency resolver.
tag The tag.

Returns

The resolved object ornull if the type could not be resolved.

Exceptions

Name Description
ArgumentNullException The dependencyResolver isnull.

Have a question about Catel? Use StackOverflow with the Catel tag!


Discussion