JsonAttributes.cs 656 B

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace FastReport.Utils.Json.Serialization
  3. {
  4. [AttributeUsage(AttributeTargets.Property,
  5. AllowMultiple = false)]
  6. public class JsonPropertyAttribute : Attribute
  7. {
  8. public string PropertyName { get; }
  9. public bool IgnoreNullValue { get; }
  10. public JsonPropertyAttribute(string propertyName, bool ignoreNullValue = true)
  11. {
  12. PropertyName = propertyName;
  13. IgnoreNullValue = ignoreNullValue;
  14. }
  15. }
  16. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
  17. public class JsonIgnoreAttribute : Attribute
  18. {
  19. }
  20. }