mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 优化 无主键使用 IUpdate.SetSource 的错误提示;
This commit is contained in:
		@@ -750,7 +750,10 @@ namespace FreeSql.Internal.CommonProvider
 | 
			
		||||
 | 
			
		||||
            sb.Append(" \r\nWHERE ");
 | 
			
		||||
            if (_source.Any())
 | 
			
		||||
            {
 | 
			
		||||
                if (_table.Primarys.Any() == false) throw new ArgumentException($"{_table.Type.DisplayCsharp()} 没有定义主键,无法使用 SetSource,请尝试 SetDto");
 | 
			
		||||
                sb.Append("(").Append(_commonUtils.WhereItems(_table, "", _source)).Append(")");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (_where.Length > 0)
 | 
			
		||||
                sb.Append(_source.Any() ? _where.ToString() : _where.ToString().Substring(5));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user