懒得勤快 2 年之前
父节点
当前提交
7ee069d67f
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      README.md

+ 10 - 0
README.md

@@ -776,7 +776,17 @@ public override Post SavePost(Post t)
 "13123456789".Mask(); // 131****5678
 "[email protected]".MaskEmail(); // a****[email protected]
 ```
+```csharp
+// Attribute的方式为json序列化时进行数据脱敏
+public class MyClass
+{
+    [JsonConverter(typeof(MaskEmailConverter))]
+    public string Email { get; set; }
 
+    [JsonConverter(typeof(MaskConverter))]
+    public string PhoneNumber { get; set; }
+}
+```
 ### 30.集合扩展
 
 ```csharp