Serilog 动态添加自定义属性
摘要:注:通过 using 的使用,可以在函数结束时自动移除属性 CallId。 代码示例: public bool UsbRegRead(uint regAddr, ref uint regData){ using (LogContext.PushProperty("CallId", Guid.NewG
阅读全文
posted @
2021-11-11 14:58
青叶煮酒
阅读(514)
推荐(0) 编辑
C# 序列化与反序列化
摘要:1. 通过 JsonSerializer 类的 Serialize/Deserialize 函数,示例代码如下: using System; using System.Text.Json; using System.Text.Json.Serialization; namespace Console
阅读全文
posted @
2021-11-02 10:06
青叶煮酒
阅读(116)
推荐(0) 编辑