mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	✨ support provider、Extensions Exceptions 多语言
This commit is contained in:
		@@ -16,11 +16,11 @@ namespace FreeSql.Sqlite.Curd
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override List<T1> ExecuteDeleted() => throw new NotImplementedException("FreeSql.Provider.Sqlite 未实现该功能");
 | 
			
		||||
        public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.Sqlite {CoreStrings.S_Not_Implemented_Feature}");
 | 
			
		||||
 | 
			
		||||
#if net40
 | 
			
		||||
#else
 | 
			
		||||
        public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Provider.Sqlite 未实现该功能");
 | 
			
		||||
        public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Sqlite {CoreStrings.S_Not_Implemented_Feature}");
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -46,14 +46,14 @@ namespace FreeSql.Sqlite.Curd
 | 
			
		||||
                    insert.InsertIdentity();
 | 
			
		||||
                    if (_doNothing == false)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (_updateIgnore.Any()) throw new Exception($"fsql.InsertOrUpdate Sqlite 无法完成 UpdateColumns 操作");
 | 
			
		||||
                        if (_updateIgnore.Any()) throw new Exception(CoreStrings.S_InsertOrUpdate_Unable_UpdateColumns);
 | 
			
		||||
                        sql = insert.ToSql();
 | 
			
		||||
                        if (sql?.StartsWith("INSERT INTO ") == true)
 | 
			
		||||
                            sql = $"REPLACE INTO {sql.Substring("INSERT INTO ".Length)}";
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        if (_table.Primarys.Any() == false) throw new Exception($"fsql.InsertOrUpdate + IfExistsDoNothing + Sqlite 要求实体类 {_table.CsName} 必须有主键");
 | 
			
		||||
                        if (_table.Primarys.Any() == false) throw new Exception(CoreStrings.Entity_Must_Primary_Key("fsql.InsertOrUpdate + IfExistsDoNothing + Sqlite ", _table.CsName));
 | 
			
		||||
                        sql = insert.ToSqlValuesOrSelectUnionAllExtension101(false, (rowd, idx, sb) =>
 | 
			
		||||
                            sb.Append(" \r\n WHERE NOT EXISTS(").Append(
 | 
			
		||||
                                _orm.Select<T1>()
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ namespace FreeSql.Sqlite.Curd
 | 
			
		||||
        public override int ExecuteAffrows() => base.SplitExecuteAffrows(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999);
 | 
			
		||||
        public override List<T1> ExecuteUpdated() => base.SplitExecuteUpdated(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999);
 | 
			
		||||
 | 
			
		||||
        protected override List<T1> RawExecuteUpdated() => throw new NotImplementedException("FreeSql.Provider.Sqlite 未实现该功能");
 | 
			
		||||
        protected override List<T1> RawExecuteUpdated() => throw new NotImplementedException($"FreeSql.Provider.Sqlite {CoreStrings.S_Not_Implemented_Feature}");
 | 
			
		||||
 | 
			
		||||
        protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys)
 | 
			
		||||
        {
 | 
			
		||||
@@ -66,7 +66,7 @@ namespace FreeSql.Sqlite.Curd
 | 
			
		||||
        public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default) => base.SplitExecuteAffrowsAsync(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, cancellationToken);
 | 
			
		||||
        public override Task<List<T1>> ExecuteUpdatedAsync(CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, cancellationToken);
 | 
			
		||||
 | 
			
		||||
        protected override Task<List<T1>> RawExecuteUpdatedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Provider.Sqlite 未实现该功能");
 | 
			
		||||
        protected override Task<List<T1>> RawExecuteUpdatedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Sqlite {CoreStrings.S_Not_Implemented_Feature}");
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user