CallingParameter.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. namespace MiniWebApi.Handler
  3. {
  4. public enum FromType
  5. {
  6. /// <summary>
  7. /// SimpleType
  8. /// </summary>
  9. None,
  10. /// <summary>
  11. /// The object is from Url, can not to large.
  12. /// </summary>
  13. FromUrl,
  14. /// <summary>
  15. /// The object is from body.
  16. /// </summary>
  17. FromBody
  18. }
  19. /// <summary>
  20. /// The parameter information for the calling method.
  21. /// </summary>
  22. public class CallingParameter
  23. {
  24. /// <summary>
  25. /// Gets the parameter's name.
  26. /// </summary>
  27. public string Name { get; }
  28. /// <summary>
  29. /// Gets the parameter's type.
  30. /// </summary>
  31. public Type ParameterType { get; }
  32. /// <summary>
  33. /// Gets the From type of this parameter.
  34. /// </summary>
  35. public FromType FromType { get; }
  36. /// <summary>
  37. /// Create the CallingParameter.
  38. /// </summary>
  39. /// <param name="name">The name of the parameter.</param>
  40. /// <param name="parameterType">The type of the parameter.</param>
  41. /// <param name="fromType">The From type of this parameter.</param>
  42. public CallingParameter(string name, Type parameterType, FromType fromType)
  43. {
  44. Name = name;
  45. ParameterType = parameterType;
  46. FromType = fromType;
  47. }
  48. }
  49. }