ServiceMetadata.cs 692 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ServiceStack.Host
  4. {
  5. public class ServiceMetadata
  6. {
  7. public ServiceMetadata()
  8. {
  9. this.OperationsMap = new Dictionary<Type, Type>();
  10. }
  11. public Dictionary<Type, Type> OperationsMap { get; protected set; }
  12. public void Add(Type serviceType, Type requestType, Type responseType)
  13. {
  14. this.OperationsMap[requestType] = serviceType;
  15. }
  16. public Type GetServiceTypeByRequest(Type requestType)
  17. {
  18. Type serviceType;
  19. OperationsMap.TryGetValue(requestType, out serviceType);
  20. return serviceType;
  21. }
  22. }
  23. }