mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	- 增加 IInsertOrUpdate.SetSource(sql) 重载方法;
This commit is contained in:
		@@ -3,6 +3,7 @@ using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data.Common;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Linq.Expressions;
 | 
			
		||||
 | 
			
		||||
namespace FreeSql.Sqlite.Curd
 | 
			
		||||
{
 | 
			
		||||
@@ -14,6 +15,15 @@ namespace FreeSql.Sqlite.Curd
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override IInsertOrUpdate<T1> SetSource(string sql, Expression<Func<T1, object>> tempPrimarys = null)
 | 
			
		||||
        {
 | 
			
		||||
            var list = _orm.Ado.CommandFluent(sql)
 | 
			
		||||
                .WithConnection(_connection)
 | 
			
		||||
                .WithTransaction(_transaction)
 | 
			
		||||
                .Query<T1>();
 | 
			
		||||
            return SetSource(list, tempPrimarys);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override string ToSql()
 | 
			
		||||
        {
 | 
			
		||||
            if (_source?.Any() != true) return null;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user