FallbackJsonProperty.cs 470 B

1234567891011121314151617181920
  1. using System;
  2. namespace Masuit.Tools.Systems;
  3. /// <summary>
  4. /// 多别名属性
  5. /// </summary>
  6. [AttributeUsage(AttributeTargets.Property)]
  7. public class FallbackJsonProperty : Attribute
  8. {
  9. public string PreferredName { get; }
  10. public string[] FallbackReadNames { get; }
  11. public FallbackJsonProperty(string preferredName, params string[] fallbackReadNames)
  12. {
  13. PreferredName = preferredName;
  14. FallbackReadNames = fallbackReadNames;
  15. }
  16. }