using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SqlSugar
{
///
/// SqlFunc to model
///
public partial class ContextMethods : IContextMethods
{
#region Root
public ObjectFuncModel JsonToSqlFuncModels(JToken sqlfunc)
{
var key = sqlfunc.First();
if (IsObjct(sqlfunc))
{
return GetFuncModelByObject(key);
}
else
{
return GetFuncModelByArray(sqlfunc);
}
}
public IFuncModel JsonToSqlFuncModels(string sqlfunc)
{
if (IsArray(sqlfunc))
{
return GetFuncModelByArray(sqlfunc);
}
else
{
return GetFuncModelByObject(sqlfunc);
}
}
#endregion
#region Level 1
private ObjectFuncModel GetFuncModelByArray(JToken sqlfunc)
{
ObjectFuncModel result = new ObjectFuncModel();
result.Parameters = new List