/src/LinFu.IoC/ServiceNotFoundException.cs
http://github.com/philiplaureano/LinFu · C# · 33 lines · 15 code · 3 blank · 15 comment · 0 complexity · 125c958d09a8ae1bf3e1d1948984802e MD5 · raw file
- using System;
- namespace LinFu.IoC
- {
- /// <summary>
- /// The exception thrown when a service type is
- /// requested from a container and that named container
- /// is unable to find or create that particular service instance.
- /// </summary>
- [Serializable]
- public class ServiceNotFoundException : Exception
- {
- private readonly Type _serviceType;
- /// <summary>
- /// Initializes the service exception using the
- /// given <paramref name="serviceType" /> as
- /// the service that was not found.
- /// </summary>
- /// <param name="serviceType">The service type being requested.</param>
- public ServiceNotFoundException(Type serviceType)
- {
- _serviceType = serviceType;
- }
- /// <summary>
- /// The error message that this particular exception
- /// will display.
- /// </summary>
- public override string Message =>
- string.Format("Service type '{0}' not found", _serviceType.AssemblyQualifiedName);
- }
- }