UniversalApiAttribute.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Edge.Core.UniversalApi
  5. {
  6. /// <summary>
  7. /// On Class indicates it's an Event declaration.
  8. /// NOTE: specify 'EventDataType' for better Api doc generation.
  9. /// On Method indicates it's a Service declaration.
  10. /// NOTE: target Method must has return type of Task.
  11. /// </summary>
  12. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)]
  13. public class UniversalApiAttribute : Attribute
  14. {
  15. public string Name { get; set; }
  16. /// <summary>
  17. /// ignore this api expose to outside
  18. /// </summary>
  19. public bool IgnoreApi { get; set; }
  20. public string Description { get; set; }
  21. /// <summary>
  22. /// A sample Json data that match the API's input parameters declartion, the caller can use this sample to start a API call.
  23. /// it's provided to help the caller to test or understand the api.
  24. /// </summary>
  25. public string InputParametersExampleJson { get; set; }
  26. /// <summary>
  27. /// indicates this Api is an event api, and the event will raise data with this type.
  28. /// </summary>
  29. public Type EventDataType { get; set; }
  30. ///// <summary>
  31. ///// like method parameter
  32. ///// </summary>
  33. //public Type ServiceInputDataType { get; set; }
  34. ///// <summary>
  35. ///// like method return data.
  36. ///// </summary>
  37. //public Type ServiceOutputDataType { get; set; }
  38. }
  39. }