public SubserviceDescription(string name, ServiceDescription serviceDesc)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentException("Subservice name cannot be null, empty, or consist of whitespace characters");
            if (!Expressions.Name.IsMatch(name))
                throw new ArgumentException(string.Format("'{0}' is not a valid subservice", name), "name");
            if (serviceDesc == null)
                throw new ArgumentNullException("serviceDesc");

            Name = name;
            Service = serviceDesc;
        }
Esempio n. 2
0
 public IHandler GetHandler(ServiceDescription serviceDescription, ServicePath path)
 {
     return handlers.GetOrAdd(path, p => factory.CreateHandler(serviceDescription, p));
 }
 public static bool TryGetSubservice(this ServiceDescription serive, string name, out ServiceDescription subservice)
 {
     subservice = serive.Subservices.FirstOrDefault(x => x.Name == name);
     return subservice != null;
 }
 public void Setup()
 {
     serviceDescription = new ServiceDescription(typeof(IMyService), "MyService", new SubserviceDescription[0],
         new[] {new MethodDescription(typeof(void), "DoSomething", new MethodParameterDescription[0])});
     serviceDescriptionBuilder = Substitute.For<IServiceDescriptionBuilder>();
     serviceDescriptionBuilder.Build(typeof(IMyService)).Returns(serviceDescription);
     container = new ServiceImplementationContainer(serviceDescriptionBuilder);
 }
 public ImplementationSet(Type serviceInterface, ServiceDescription description, ConstructorInfo constructor)
 {
     this.serviceInterface = serviceInterface;
     this.description = description;
     this.constructor = constructor;
 }
 public ServiceImplementationInfo(ServiceDescription description, object implementation)
 {
     Description = description;
     Implementation = implementation;
 }
 public ServiceImplementationInfo(Type serviceInterface, ServiceDescription description, IServiceImplementation implementation)
 {
     Interface = serviceInterface;
     Description = description;
     Implementation = implementation;
 }