Line data Source code
1 : using System;
2 :
3 : namespace Cqrs.Configuration
4 : {
5 : /// <summary>
6 : /// Provides an ability to resolve instances of objects.
7 : /// </summary>
8 : public abstract class DependencyResolver : IDependencyResolver
9 1 : {
10 : /// <summary>
11 : /// The current instance of the <see cref="IDependencyResolver"/>.
12 : /// </summary>
13 : public static IDependencyResolver Current { get; protected set; }
14 :
15 : #region Implementation of IDependencyResolver
16 :
17 : /// <summary>
18 : /// Resolves a single instance for the specified <typeparamref name="T"/>.
19 : /// Different implementations may return the first or last instance found or may return an exception.
20 : /// </summary>
21 : /// <typeparam name="T">The <see cref="Type"/> of object you want to resolve.</typeparam>
22 : /// <returns>An instance of type <typeparamref name="T"/>.</returns>
23 1 : public abstract T Resolve<T>();
24 :
25 : /// <summary>
26 : /// Resolves a single instance for the specified <paramref name="type"/>.
27 : /// Different implementations may return the first or last instance found or may return an exception.
28 : /// </summary>
29 : /// <param name="type">The <see cref="Type"/> of object you want to resolve.</param>
30 : /// <returns>An instance of type <paramref name="type"/>.</returns>
31 1 : public abstract object Resolve(Type type);
32 :
33 : #endregion
34 : }
35 : }
|