123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- namespace Wayne.Lib
- {
-
-
-
- public class ServiceContainerException : ApplicationException
- {
-
-
-
- public Type ServiceType { get; private set; }
- internal ServiceContainerException(Type serviceType, string message)
- : base(message)
- {
- ServiceType = serviceType;
- }
-
-
-
-
-
- public static ServiceContainerException CreateNotFoundException(Type type)
- {
- return new ServiceContainerException(type, string.Format("Service {0} not found!", type));
- }
-
-
-
-
-
-
- public static ServiceContainerException CreateDependencyNotFound(Type typeToCreate, Type dependency)
- {
- return new ServiceContainerException(typeToCreate, string.Format("Type {0} could not be created because dependency {1} could not be found in the container!", typeToCreate, dependency));
- }
- }
- }
|