support provider、Extensions Exceptions 多语言

This commit is contained in:
igeekfan
2022-06-10 03:05:27 +08:00
parent e9949b58ff
commit 4fa125e93c
128 changed files with 1369 additions and 608 deletions

View File

@ -16,11 +16,11 @@ namespace FreeSql.Custom
{
}
public override List<T1> ExecuteDeleted() => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@ -62,7 +62,7 @@ namespace FreeSql.Custom
return ret;
}
protected override List<T1> RawExecuteInserted() => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
protected override List<T1> RawExecuteInserted() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
#if net40
#else
@ -107,7 +107,7 @@ namespace FreeSql.Custom
}
return ret;
}
protected override Task<List<T1>> RawExecuteInsertedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
protected override Task<List<T1>> RawExecuteInsertedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@ -35,7 +35,7 @@ namespace FreeSql.Custom
if (_limit > 0 && _utils.Adapter.SelectTopStyle == CustomAdapter.SelecTopStyle.Top) sb.Append("TOP ").Append(_skip + _limit).Append(" ");
sb.Append(field);
if (_skip > 0 && _utils.Adapter.SelectTopStyle == CustomAdapter.SelecTopStyle.Top)
throw new NotImplementedException("FreeSql.Provider.Custom 未实现 Skip/Offset 功能,如果需要分页请使用判断上一次 id");
throw new NotImplementedException(CoreStrings.S_NotImplementSkipOffset("Custom"));
sb.Append(" \r\nFROM ");
var tbsjoin = _tables.Where(a => a.Type != SelectTableInfoType.From).ToArray();

View File

@ -23,7 +23,7 @@ namespace FreeSql.Custom
public override int ExecuteAffrows() => base.SplitExecuteAffrows(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255);
public override List<T1> ExecuteUpdated() => base.SplitExecuteUpdated(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255);
protected override List<T1> RawExecuteUpdated() => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
protected override List<T1> RawExecuteUpdated() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys)
{
@ -65,7 +65,7 @@ namespace FreeSql.Custom
public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default) => base.SplitExecuteAffrowsAsync(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255, cancellationToken);
public override Task<List<T1>> ExecuteUpdatedAsync(CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255, cancellationToken);
protected override Task<List<T1>> RawExecuteUpdatedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
protected override Task<List<T1>> RawExecuteUpdatedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@ -23,7 +23,7 @@ namespace FreeSql.Custom
_CreateParameterCommand = CreateCommand();
return;
}
throw new Exception("FreeSql.Provider.CustomAdapter 仅支持 UseConnectionFactory 方式构建 IFreeSql");
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
CustomAdapter Adapter => (_util == null ? FreeSqlCustomAdapterGlobalExtensions.DefaultAdapter : _util._orm.GetCustomAdapter());
@ -65,7 +65,7 @@ namespace FreeSql.Custom
cmd.Connection = null;
return cmd;
}
throw new Exception("FreeSql.Provider.CustomAdapter 无法使用 CreateCommand");
throw new Exception(CoreStrings.S_CustomAdapter_Cannot_Use_CreateCommand);
}
public DbParameter CreateParameter()
{

View File

@ -90,6 +90,6 @@ namespace FreeSql.Custom
return null;
}
protected override string GetComparisonDDLStatements(params TypeAndName[] objects) => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
protected override string GetComparisonDDLStatements(params TypeAndName[] objects) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
}
}

View File

@ -18,9 +18,9 @@ namespace FreeSql.Custom
public override IInsert<T1> CreateInsertProvider<T1>() => new CustomInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
public override IUpdate<T1> CreateUpdateProvider<T1>(object dywhere) => new CustomUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
public override IDelete<T1> CreateDeleteProvider<T1>(object dywhere) => new CustomDelete<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
public override IInsertOrUpdate<T1> CreateInsertOrUpdateProvider<T1>() => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
public override IInsertOrUpdate<T1> CreateInsertOrUpdateProvider<T1>() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
public override IDbFirst DbFirst => throw new NotImplementedException("FreeSql.Provider.Custom 未实现该功能");
public override IDbFirst DbFirst => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
public CustomProvider(string masterConnectionString, string[] slaveConnectionString, Func<DbConnection> connectionFactory = null)
{