/src/LinFu.IoC/Configuration/Interfaces/IMemberResolver.cs

http://github.com/philiplaureano/LinFu · C# · 29 lines · 12 code · 1 blank · 16 comment · 0 complexity · 12f2ea310114d4f1e87462612a86a50e MD5 · raw file

  1. using System;
  2. using System.Reflection;
  3. using LinFu.IoC.Interfaces;
  4. namespace LinFu.IoC.Configuration.Interfaces
  5. {
  6. /// <summary>
  7. /// Represents a class that can choose a member that best matches
  8. /// the services currently available in a given <see cref="IServiceContainer" /> instance.
  9. /// </summary>
  10. /// <typeparam name="TMember">The member type that will be searched.</typeparam>
  11. public interface IMemberResolver<TMember>
  12. where TMember : MemberInfo
  13. {
  14. /// <summary>
  15. /// Uses the <paramref name="container" /> to determine which member can be used to instantiate
  16. /// a <paramref name="concreteType">concrete type</paramref>.
  17. /// </summary>
  18. /// <param name="concreteType">The target type.</param>
  19. /// <param name="container">
  20. /// The container that contains the service instances that will be used to invoke the target
  21. /// member.
  22. /// </param>
  23. /// <param name="finderContext">The <see cref="IMethodFinderContext" /> that describes the target method.</param>
  24. /// <returns>A <typeparamref name="TMember" /> instance if a match is found; otherwise, it will return <c>null</c>.</returns>
  25. TMember ResolveFrom(Type concreteType, IServiceContainer container,
  26. IMethodFinderContext finderContext);
  27. }
  28. }