diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs index ddb4ad4..329c2d5 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs @@ -197,7 +197,16 @@ namespace Falcon.SugarApi.DatabaseDefinitions /// 增加其他的参数 /// 参数 public SugarParameter[] GetParameters(T data, params SugarParameter[] otherParams) { - var result = data == null ? new List() : this.Ado.GetParameters(data).ToList(); + var result = new List(); + if (data != null) { + var dict = new Dictionary(); + foreach (var p in data.GetType().GetProperties()) { + if (p.CanRead) { + dict.Add(p.Name, p.GetValue(data) ?? ""); + } + } + result.AddRange(this.Ado.GetParameters(dict).ToArray()); + } if (otherParams != null) { result.AddRange(otherParams); }