考虑以下代码:
var d1 = new { x = 5, y = 88 };
Log.Logger.Information("{d1}", d1);
Log.Logger.Information("{@d1}", d1);
两个Log.Logger.Information(...)行中,d1中的对象将如何有所不同?
换句话说,在{ }之间添加@的效果是什么?
我阅读了“保留对象结构”下的https://github.com/serilog/serilog/wiki/Structured-Data ,但这对我来说没有意义。
{..}
(默认),{$..}
(字符串化)和{@..}
(解构)。这个 链接 或许 更有帮助? - user824425