19 namespace Deveel.Data.Services {
24 if (serviceType == null)
25 throw new ArgumentNullException(
"serviceType");
26 if (implementationType == null)
27 throw new ArgumentNullException(
"implementationType");
29 if (!serviceType.IsAssignableFrom(implementationType))
30 throw new ArgumentException(
31 String.Format(
"The implementation type '{0} is not assignable from the service type '{1}'.",
32 implementationType, serviceType));
34 ServiceType = serviceType;
35 ImplementationType = implementationType;
38 public Type ServiceType {
get;
private set; }
40 public Type ImplementationType {
get;
private set; }
42 public object ServiceKey {
get; set; }
44 public string Scope {
get; set; }
46 public object Instance {
47 get {
return instance; }
50 !ServiceType.IsInstanceOfType(value))
51 throw new ArgumentException(String.Format(
"The instance is not assignable from '{0}'.", ServiceType));
ServiceRegistration(Type serviceType, Type implementationType)