From c88f06e59e90f42e869f6ce3615c7f637f0a0941 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 25 Feb 2022 09:35:18 +0800 Subject: [PATCH] Update table query --- .../SqlSugar/Infrastructure/ContextMethods.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index 17bbbe621..e84935a46 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -726,12 +726,22 @@ namespace SqlSugar } else { - IConditionalModel conditionalModel = new ConditionalModel() + var typeValue = item["ConditionalType"].Value(); + + ConditionalModel conditionalModel = new ConditionalModel() { - ConditionalType = (ConditionalType)Convert.ToInt32(item["ConditionalType"].Value()), + // ConditionalType = (ConditionalType)Convert.ToInt32(), FieldName = item["FieldName"] + "", FieldValue = item["FieldValue"].Value()==null?null: item["FieldValue"].ToString() }; + if (typeValue.IsInt()) + { + conditionalModel.ConditionalType = (ConditionalType)Convert.ToInt32(typeValue); + } + else + { + conditionalModel.ConditionalType = (ConditionalType)Enum.Parse(typeof(ConditionalType),typeValue.ObjToString()); + } conditionalModels.Add(conditionalModel); } }