Browse Source

CreateDynamicClass 去掉字符'.'

xf 11 months ago
parent
commit
160388ea84
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Hotline/Tools/DynamicClassHelper.cs

+ 1 - 1
src/Hotline/Tools/DynamicClassHelper.cs

@@ -18,7 +18,7 @@ public class DynamicClassHelper
 
 
         foreach (var property in propInfos)
         foreach (var property in propInfos)
         {
         {
-            var propertyName = property.Prop;
+            var propertyName = property.Prop.Trim().Replace(".", "");
             var propertyType = typeof(string);
             var propertyType = typeof(string);
 
 
             FieldBuilder fieldBuilder = typeBuilder.DefineField("_" + propertyName, propertyType, FieldAttributes.Private);
             FieldBuilder fieldBuilder = typeBuilder.DefineField("_" + propertyName, propertyType, FieldAttributes.Private);