修复执行存储过程参数相关错误
This commit is contained in:
		
							parent
							
								
									0bcaef1383
								
							
						
					
					
						commit
						760b5b9b43
					
				@ -197,7 +197,16 @@ namespace Falcon.SugarApi.DatabaseDefinitions
 | 
			
		||||
        /// <param name="otherParams">增加其他的参数</param>
 | 
			
		||||
        /// <returns>参数</returns>
 | 
			
		||||
        public SugarParameter[] GetParameters<T>(T data, params SugarParameter[] otherParams) {
 | 
			
		||||
            var result = data == null ? new List<SugarParameter>() : this.Ado.GetParameters(data).ToList();
 | 
			
		||||
            var result = new List<SugarParameter>();
 | 
			
		||||
            if (data != null) {
 | 
			
		||||
                var dict = new Dictionary<string, object>();
 | 
			
		||||
                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);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user