1
hutongqing
2024-09-24 a89c018c3afa43a529f9eb54725bc92ed2b996e8
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs
@@ -25,7 +25,10 @@
        public static T CodeAnalysis<T>(AnalysisCode analysisCode, string code)
        {
            Type type = typeof(T);
            T result = (T)Activator.CreateInstance(type);
            object? obj = Activator.CreateInstance(type);
            if (obj == null)
                throw new Exception("实例化对象错误");
            T result = (T)obj;
            try
            {
                AnalysisRuleAttribute? analysisRule = type.GetCustomAttribute<AnalysisRuleAttribute>();
@@ -122,7 +125,7 @@
                                        AnalysisItemRuleAttribute? analysisItemRule = propertyInfo.GetCustomAttribute<AnalysisItemRuleAttribute>();
                                        if (analysisItemRule != null)
                                        {
                                            if(analysisItemRule.AnalysisFormaType == AnalysisFormaType.BD)
                                            if(analysisItemRule.AnalysisFormaType == AnalysisFormatType.BD)
                                            {
                                                propertyInfo.SetValue(result, code.ChangeType(propertyInfo.PropertyType));
                                            }