From 2dd3d2d3138ac27c390d7f9a74f6063f1e190ec7 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Mon, 15 Apr 2024 16:34:48 +0800 Subject: [PATCH] =?UTF-8?q?encode=E6=B3=A8=E8=A7=A3=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HybirdFrameworkCore/Utils/ModelConvert.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HybirdFrameworkCore/Utils/ModelConvert.cs b/HybirdFrameworkCore/Utils/ModelConvert.cs index 6d36d16..a2a2090 100644 --- a/HybirdFrameworkCore/Utils/ModelConvert.cs +++ b/HybirdFrameworkCore/Utils/ModelConvert.cs @@ -110,8 +110,9 @@ public static class ModelConvert if (start <= attribute.Start) { start = attribute.Start; - length = attribute.Length; + length = PropertyReadConstant.Byte == attribute.Type ? attribute.Length * 8 : attribute.Length; } + dictionary.Add(attribute, field); } } @@ -127,7 +128,7 @@ public static class ModelConvert PropertyInfo field = dictionary[attribute]; byte[] value = GetPropertyValue(t, field, attribute); start = attribute.Start; - length = attribute.Length; + length = PropertyReadConstant.Byte == attribute.Type ? attribute.Length * 8 : attribute.Length; for (int i = 0; i < length; i++) {