mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update json 2 sql
This commit is contained in:
@@ -909,9 +909,9 @@ namespace SqlSugar
|
||||
{
|
||||
conditionalModel = new ConditionalModel()
|
||||
{
|
||||
ConditionalType = (ConditionalType)Convert.ToInt32(value["ConditionalType"].Value<int>()),
|
||||
ConditionalType = GetConditionalType(value),
|
||||
FieldName = value["FieldName"] + "",
|
||||
CSharpTypeName= value["CSharpTypeName"].ObjToString().IsNullOrEmpty()? null : value["CSharpTypeName"].ObjToString(),
|
||||
CSharpTypeName = value["CSharpTypeName"].ObjToString().IsNullOrEmpty() ? null : value["CSharpTypeName"].ObjToString(),
|
||||
FieldValue = value["FieldValue"].Value<string>() == null ? null : value["FieldValue"].ToString()
|
||||
};
|
||||
}
|
||||
@@ -919,5 +919,18 @@ namespace SqlSugar
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ConditionalType GetConditionalType(JToken value)
|
||||
{
|
||||
if (value["ConditionalType"].Type == JTokenType.String)
|
||||
{
|
||||
var stringValue = value["ConditionalType"].Value<string>();
|
||||
if (!stringValue.IsInt())
|
||||
{
|
||||
return (ConditionalType)Enum.Parse(typeof(ConditionalType), stringValue);
|
||||
}
|
||||
}
|
||||
return (ConditionalType)Convert.ToInt32(value["ConditionalType"].Value<int>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user