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++) {