From 966426eaed17fe07f3c05eb5c3dd94b2b25f4ccd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 1 Sep 2025 19:44:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=99=84=E4=BB=B6=E8=B0=83=E8=AF=95=E5=99=A8=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E5=8E=9F=E5=A7=8B=E7=94=B5=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Socket/DataConverter/DataConverter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs index 730bb469..55dbac0e 100644 --- a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs +++ b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs @@ -3,6 +3,7 @@ // Website: https://www.blazor.zone or https://argozhang.github.io/ using BootstrapBlazor.Socket.Logging; +using System.Diagnostics; using System.Reflection; namespace BootstrapBlazor.Socket.DataConverters; @@ -64,7 +65,12 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) if (entity != null) { // 通过 SocketDataPropertyConverterAttribute 特性获取属性转换器 + var debug = System.Diagnostics.Debugger.IsAttached; var properties = entity.GetType().GetProperties().Where(p => p.CanWrite).ToList(); + if (Debugger.IsAttached) + { + SocketLogging.LogDebug($"Data: {BitConverter.ToString(data.ToArray())}"); + } foreach (var p in properties) { var attr = p.GetCustomAttribute(false) ?? GetPropertyConverterAttribute(p); @@ -78,7 +84,7 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) } else { - SocketLogging.LogInformation($"{nameof(Parse)} failed. Can't convert value from {GetValueType(valueType)} to {p.PropertyType}"); + SocketLogging.LogInformation($"{nameof(Parse)} failed. Data: {BitConverter.ToString(data.ToArray())}. Start: {attr.Offset}. Length: {attr.Length}. Can't convert value from {GetValueType(valueType)} to {p.PropertyType}"); } } } From bf39f294cbbd9a63acb37f07770be34975b6f7d7 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 1 Sep 2025 19:44:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=A1=E6=81=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Socket/DataConverter/DataConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs index 55dbac0e..4aa53230 100644 --- a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs +++ b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs @@ -84,7 +84,7 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) } else { - SocketLogging.LogInformation($"{nameof(Parse)} failed. Data: {BitConverter.ToString(data.ToArray())}. Start: {attr.Offset}. Length: {attr.Length}. Can't convert value from {GetValueType(valueType)} to {p.PropertyType}"); + SocketLogging.LogInformation($"{nameof(Parse)} failed. Start: {attr.Offset}. Length: {attr.Length}. Can't convert value from {GetValueType(valueType)} to {p.Name}({p.PropertyType})"); } } } From 921daf993b54c3d7eee5eb53e630542f81a0e078 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 1 Sep 2025 19:44:39 +0800 Subject: [PATCH 3/4] chore: bump version 9.0.14 --- .../BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj b/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj index 4f0ed118..0cee55f8 100644 --- a/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj +++ b/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj @@ -1,7 +1,7 @@  - 9.0.11 + 9.0.14 From 94803809e29997f7b0fafbc1e82993a98f0f4e17 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 2 Sep 2025 11:12:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?doc:=20=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.Socket/DataConverter/DataConverter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs index 4aa53230..672efdfc 100644 --- a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs +++ b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs @@ -65,7 +65,6 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) if (entity != null) { // 通过 SocketDataPropertyConverterAttribute 特性获取属性转换器 - var debug = System.Diagnostics.Debugger.IsAttached; var properties = entity.GetType().GetProperties().Where(p => p.CanWrite).ToList(); if (Debugger.IsAttached) {