- 调整 resources 转换成 static class 静态类;#1917

This commit is contained in:
2881099
2024-11-08 14:35:10 +08:00
parent fa0e5ba0e2
commit 01b9ae0076
228 changed files with 3538 additions and 4961 deletions

View File

@@ -94,9 +94,9 @@ namespace FreeSql
{
if (newdata == null) return null;
var _table = Orm.CodeFirst.GetTableByEntity(EntityType);
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.Incomparable_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, newdata)));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.Incomparable_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, newdata)));
var key = Orm.GetEntityKeyString(EntityType, newdata, false);
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextStrings.Incomparable_PrimaryKey_NotSet(Orm.GetEntityString(EntityType, newdata)));
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextErrorStrings.Incomparable_PrimaryKey_NotSet(Orm.GetEntityString(EntityType, newdata)));
if (_states.TryGetValue(key, out var oldState) == false || oldState == null) throw new Exception($"不可对比,数据未被跟踪:{Orm.GetEntityString(EntityType, newdata)}");
AggregateRootTrackingChangeInfo tracking = new AggregateRootTrackingChangeInfo();
AggregateRootUtils.CompareEntityValue(_boundaryName, Orm, EntityType, oldState, newdata, null, tracking);

View File

@@ -154,7 +154,7 @@ namespace FreeSql
var stateKey = Orm.GetEntityKeyString(EntityType, entity, false);
if (entity == null) throw new ArgumentNullException(nameof(entity));
var table = Orm.CodeFirst.GetTableByEntity(EntityType);
if (table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, entity)));
if (table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, entity)));
var flagExists = ExistsInStates(entity);
if (flagExists == false)

View File

@@ -32,7 +32,7 @@ namespace FreeSql
{
if (data == null) return;
var table = Orm.CodeFirst.GetTableByEntity(EntityType);
if (table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotEdit_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, data.First())));
if (table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotEdit_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, data.First())));
_statesEditing.Clear();
_dataEditing = data;
foreach (var item in data)
@@ -216,7 +216,7 @@ namespace FreeSql
var stateKey = Orm.GetEntityKeyString(EntityType, entity, false);
if (entity == null) throw new ArgumentNullException(nameof(entity));
var table = Orm.CodeFirst.GetTableByEntity(EntityType);
if (table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, entity)));
if (table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(Orm.GetEntityString(EntityType, entity)));
var flagExists = ExistsInStates(entity);
if (flagExists == false)

View File

@@ -499,7 +499,7 @@ namespace FreeSql
void LocalInclude(TableRef tbref, Expression exp)
{
var incMethod = queryExp.Type.GetMethod("Include");
if (incMethod == null) throw new Exception(CoreStrings.RunTimeError_Reflection_IncludeMany.Replace("IncludeMany", "Include"));
if (incMethod == null) throw new Exception(CoreErrorStrings.RunTimeError_Reflection_IncludeMany.Replace("IncludeMany", "Include"));
queryExp = Expression.Call(queryExp, incMethod.MakeGenericMethod(tbref.RefEntityType),
Expression.Lambda(typeof(Func<,>).MakeGenericType(entityType, tbref.RefEntityType), exp, navigateParameterExp));
}
@@ -508,7 +508,7 @@ namespace FreeSql
var funcType = typeof(Func<,>).MakeGenericType(entityType, typeof(IEnumerable<>).MakeGenericType(tbref.RefEntityType));
var navigateSelector = Expression.Lambda(funcType, exp, navigateParameterExp);
var incMethod = queryExp.Type.GetMethod("IncludeMany");
if (incMethod == null) throw new Exception(CoreStrings.RunTimeError_Reflection_IncludeMany);
if (incMethod == null) throw new Exception(CoreErrorStrings.RunTimeError_Reflection_IncludeMany);
LambdaExpression navigateThen = null;
var navigateThenType = typeof(Action<>).MakeGenericType(typeof(ISelect<>).MakeGenericType(tbref.RefEntityType));
var thenParameter = Expression.Parameter(typeof(ISelect<>).MakeGenericType(tbref.RefEntityType), "then");

View File

@@ -24,7 +24,7 @@ namespace FreeSql
static Func<IFreeSql> _resoleOrm;
internal static Func<IUnitOfWork> _resolveUow;
public static IFreeSql Orm => _resoleOrm?.Invoke() ?? throw new Exception(CoreStrings.S_BaseEntity_Initialization_Error);
public static IFreeSql Orm => _resoleOrm?.Invoke() ?? throw new Exception(CoreErrorStrings.S_BaseEntity_Initialization_Error);
public static void Initialization(IFreeSql fsql, Func<IUnitOfWork> resolveUow) => Initialization(() => fsql, resolveUow);
public static void Initialization(Func<IFreeSql> resoleOrm, Func<IUnitOfWork> resolveUow)

View File

@@ -33,7 +33,7 @@ public static class FreeSqlExtensionsLinqSql
/// <returns></returns>
public static ISelect<T1> RestoreToSelect<T1>(this IQueryable<T1> that) where T1 : class
{
var queryable = that as QueryableProvider<T1, T1> ?? throw new Exception(CoreStrings.S_CannotBeConverted_To_ISelect(typeof(T1).Name));
var queryable = that as QueryableProvider<T1, T1> ?? throw new Exception(CoreErrorStrings.S_CannotBeConverted_To_ISelect(typeof(T1).Name));
return queryable._select;
}

View File

@@ -121,7 +121,7 @@ namespace FreeSql.Extensions.Linq
case "Average": return tplMaxMinAvgSum("Avg");
case "Concat":
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "Contains":
if (callExp.Arguments.Count == 2)
{
@@ -141,7 +141,7 @@ namespace FreeSql.Extensions.Linq
_select.Distinct();
break;
}
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "ElementAt":
case "ElementAtOrDefault":
@@ -178,7 +178,7 @@ namespace FreeSql.Extensions.Linq
_select.InternalWhere(whereParam);
break;
}
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "Skip":
_select.Offset((int)callExp.Arguments[1].GetConstExprValue());
@@ -190,7 +190,7 @@ namespace FreeSql.Extensions.Linq
case "ToList":
if (callExp.Arguments.Count == 1)
return _select.ToList();
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "Select":
var selectParam = (callExp.Arguments[1] as UnaryExpression)?.Operand as LambdaExpression;
@@ -199,7 +199,7 @@ namespace FreeSql.Extensions.Linq
_select._selectExpression = selectParam;
break;
}
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "Join":
if (callExp.Arguments.Count == 5)
@@ -241,13 +241,13 @@ namespace FreeSql.Extensions.Linq
case "Last":
case "LastOrDefault":
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
case "GroupBy":
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
default:
return throwCallExp(CoreStrings.Not_Support);
return throwCallExp(CoreErrorStrings.Not_Support);
}
}
if (tresult == null) return null;

View File

@@ -571,7 +571,7 @@ namespace FreeSql.Extensions.ZeroEntity
var ta = _tableAlias.Where(a => string.Join(".", a.NavPath) == navPath).FirstOrDefault();
if (ta?.Table.ColumnsByCs.TryGetValue(field.Last(), out var col) == true)
return NativeTuple.Create($"{ta.Alias}.{_common.QuoteSqlName(col.Attribute.Name)}", col);
throw new Exception(CoreStrings.Cannot_Match_Property(property));
throw new Exception(CoreErrorStrings.Cannot_Match_Property(property));
}
/// <summary>

View File

@@ -295,12 +295,12 @@ ManyToMany 级联删除中间表(注意不删除外部根)
_orm.Aop.TraceBeforeHandler?.Invoke(this, transBefore);
handler?.Invoke();
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
finally

View File

@@ -163,7 +163,7 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat双击它重新
case "-nameoptions":
ArgsNameOptions = args[a + 1].Split(',').Select(opt => opt == "1").ToArray();
if (ArgsNameOptions.Length != 4) throw new ArgumentException(CoreStrings.S_NameOptions_Incorrect);
if (ArgsNameOptions.Length != 4) throw new ArgumentException(CoreErrorStrings.S_NameOptions_Incorrect);
a++;
break;
case "-namespace":
@@ -172,7 +172,7 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat双击它重新
break;
case "-db":
var dbargs = args[a + 1].Split(',', 2);
if (dbargs.Length != 2) throw new ArgumentException(CoreStrings.S_DB_ParameterError);
if (dbargs.Length != 2) throw new ArgumentException(CoreErrorStrings.S_DB_ParameterError);
switch (dbargs[0].Trim().ToLower())
{
@@ -186,7 +186,7 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat双击它重新
case "kingbasees": ArgsDbType = DataType.KingbaseES; break;
case "shentong": ArgsDbType = DataType.ShenTong; break;
case "clickhouse": ArgsDbType = DataType.ClickHouse; break;
default: throw new ArgumentException(CoreStrings.S_DB_ParameterError_UnsupportedType(dbargs[0]));
default: throw new ArgumentException(CoreErrorStrings.S_DB_ParameterError_UnsupportedType(dbargs[0]));
}
ArgsConnectionString = dbargs[1].Trim();
a++;
@@ -225,11 +225,11 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat双击它重新
a++;
break;
default:
throw new ArgumentException(CoreStrings.S_WrongParameter(args[a]));
throw new ArgumentException(CoreErrorStrings.S_WrongParameter(args[a]));
}
}
if (string.IsNullOrEmpty(ArgsConnectionString)) throw new ArgumentException(CoreStrings.S_DB_Parameter_Error_NoConnectionString);
if (string.IsNullOrEmpty(ArgsConnectionString)) throw new ArgumentException(CoreErrorStrings.S_DB_Parameter_Error_NoConnectionString);
RazorEngine.Engine.Razor = RazorEngineService.Create(new RazorEngine.Configuration.TemplateServiceConfiguration
{

View File

@@ -12,12 +12,12 @@ namespace FreeSql
public abstract partial class DbContext : IDisposable
{
internal DbContextScopedFreeSql _ormScoped;
internal IFreeSql OrmOriginal => _ormScoped?._originalFsql ?? throw new ArgumentNullException(DbContextStrings.ConfigureUseFreeSql);
internal IFreeSql OrmOriginal => _ormScoped?._originalFsql ?? throw new ArgumentNullException(DbContextErrorStrings.ConfigureUseFreeSql);
/// <summary>
/// 该对象 Select/Delete/Insert/Update/InsertOrUpdate 与 DbContext 事务保持一致,可省略传递 WithTransaction
/// </summary>
public IFreeSql Orm => _ormScoped ?? throw new ArgumentNullException(DbContextStrings.ConfigureUseFreeSql);
public IFreeSql Orm => _ormScoped ?? throw new ArgumentNullException(DbContextErrorStrings.ConfigureUseFreeSql);
#region Property UnitOfWork
internal bool _isUseUnitOfWork = true; //是否创建工作单元事务
@@ -135,7 +135,7 @@ namespace FreeSql
void CheckEntityTypeOrThrow(Type entityType)
{
if (OrmOriginal.CodeFirst.GetTableByEntity(entityType) == null)
throw new ArgumentException(DbContextStrings.ParameterDataTypeError(entityType.FullName));
throw new ArgumentException(DbContextErrorStrings.ParameterDataTypeError(entityType.FullName));
}
/// <summary>
/// 添加

View File

@@ -0,0 +1,266 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FreeSql
{
public static class DbContextErrorStrings
{
public static string Language = "en";
/// <summary>
/// AddFreeDbContext 发生错误,请检查 {dbContextTypeName} 的构造参数都已正确注入
/// </summary>
public static string AddFreeDbContextError_CheckConstruction(object dbContextTypeName) => string.Format(Language == "cn" ?
@"AddFreeDbContext 发生错误,请检查 {0} 的构造参数都已正确注入" :
@"FreeSql: An error occurred in AddFreeDbContext, check that the construction parameters of {0} have been injected correctly", dbContextTypeName);
/// <summary>
/// 不可添加,已存在于状态管理:{entityString}
/// </summary>
public static string CannotAdd_AlreadyExistsInStateManagement(object entityString) => string.Format(Language == "cn" ?
@"不可添加,已存在于状态管理:{0}" :
@"FreeSql: Not addable, already exists in state management: {0}", entityString);
/// <summary>
/// 不可添加,实体没有主键:{entityString}
/// </summary>
public static string CannotAdd_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可添加,实体没有主键:{0}" :
@"FreeSql: Not addable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可添加,未设置主键的值:{entityString}
/// </summary>
public static string CannotAdd_PrimaryKey_NotSet(object entityString) => string.Format(Language == "cn" ?
@"不可添加,未设置主键的值:{0}" :
@"FreeSql: Not addable, no value for primary key set: {0}", entityString);
/// <summary>
/// 不可添加,自增属性有值:{entityString}
/// </summary>
public static string CannotAdd_SelfIncreasingHasValue(object entityString) => string.Format(Language == "cn" ?
@"不可添加,自增属性有值:{0}" :
@"FreeSql: Not addable, self-increasing attribute has value: {0}", entityString);
/// <summary>
/// 不可附加,实体没有主键:{entityString}
/// </summary>
public static string CannotAttach_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可附加,实体没有主键:{0}" :
@"FreeSql: Not attachable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可附加,未设置主键的值:{entityString}
/// </summary>
public static string CannotAttach_PrimaryKey_NotSet(object entityString) => string.Format(Language == "cn" ?
@"不可附加,未设置主键的值:{0}" :
@"FreeSql: Not attachable, no value for primary key set: {0}", entityString);
/// <summary>
/// 不可删除,数据未被跟踪,应该先查询:{entityString}
/// </summary>
public static string CannotDelete_DataNotTracked_ShouldQuery(object entityString) => string.Format(Language == "cn" ?
@"不可删除,数据未被跟踪,应该先查询:{0}" :
@"FreeSql: Not deletable, data not tracked, should query first: {0}", entityString);
/// <summary>
/// 不可删除,实体没有主键:{entityString}
/// </summary>
public static string CannotDelete_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可删除,实体没有主键:{0}" :
@"FreeSql: Not deletable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可删除,未设置主键的值:{entityString}
/// </summary>
public static string CannotDelete_PrimaryKey_NotSet(object entityString) => string.Format(Language == "cn" ?
@"不可删除,未设置主键的值:{0}" :
@"FreeSql: Not deletable, no value for primary key set: {0}", entityString);
/// <summary>
/// 不可进行编辑,实体没有主键:{entityString}
/// </summary>
public static string CannotEdit_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可进行编辑,实体没有主键:{0}" :
@"FreeSql: Not editable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可更新,数据未被跟踪,应该先查询 或者 Attach{entityString}
/// </summary>
public static string CannotUpdate_DataShouldQueryOrAttach(object entityString) => string.Format(Language == "cn" ?
@"不可更新,数据未被跟踪,应该先查询 或者 Attach{0}" :
@"FreeSql: Not updatable, data not tracked, should be queried first or Attach:{0}", entityString);
/// <summary>
/// 不可更新,实体没有主键:{entityString}
/// </summary>
public static string CannotUpdate_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可更新,实体没有主键:{0}" :
@"FreeSql: Not updatable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可更新,未设置主键的值:{entityString}
/// </summary>
public static string CannotUpdate_PrimaryKey_NotSet(object entityString) => string.Format(Language == "cn" ?
@"不可更新,未设置主键的值:{0}" :
@"FreeSql: Not updatable, no value for primary key set: {0}", entityString);
/// <summary>
/// 不可更新,数据库不存在该记录:{entityString}
/// </summary>
public static string CannotUpdate_RecordDoesNotExist(object entityString) => string.Format(Language == "cn" ?
@"不可更新,数据库不存在该记录:{0}" :
@"FreeSql: Not updatable, the record does not exist in the database: {0}", entityString);
/// <summary>
/// 请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql
/// </summary>
public static string ConfigureUseFreeSql => Language == "cn" ?
@"请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql" :
@"FreeSql: Please configure UseFreeSql in OnConfiguring or AddFreeDbContext";
/// <summary>
/// DbSet.AsType 参数错误,请传入正确的实体类型
/// </summary>
public static string DbSetAsType_NotSupport_Object => Language == "cn" ?
@"DbSet.AsType 参数错误,请传入正确的实体类型" :
@"FreeSql: DbSet. AsType parameter error, please pass in the correct entity type";
/// <summary>
/// 实体类型 {EntityTypeName} 无法转换为 {name},无法使用该方法
/// </summary>
public static string EntityType_CannotConvert(object EntityTypeName, object name) => string.Format(Language == "cn" ?
@"实体类型 {0} 无法转换为 {1},无法使用该方法" :
@"FreeSql: Entity type {0} cannot be converted to {1} and cannot use this method", EntityTypeName, name);
/// <summary>
/// 实体类型 {EntityTypeName} 主键类型不为 {fullName},无法使用该方法
/// </summary>
public static string EntityType_PrimaryKeyError(object EntityTypeName, object fullName) => string.Format(Language == "cn" ?
@"实体类型 {0} 主键类型不为 {1},无法使用该方法" :
@"FreeSql: Entity type {0} Primary key type is not {1} and cannot be used with this method", EntityTypeName, fullName);
/// <summary>
/// 实体类型 {EntityTypeName} 主键数量不为 1无法使用该方法
/// </summary>
public static string EntityType_PrimaryKeyIsNotOne(object EntityTypeName) => string.Format(Language == "cn" ?
@"实体类型 {0} 主键数量不为 1无法使用该方法" :
@"FreeSql: Entity type {0} Primary key number is not 1 and cannot be used with this method", EntityTypeName);
/// <summary>
/// FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository
/// </summary>
public static string FailedSetFilter_NotBelongIRpository => Language == "cn" ?
@"FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository" :
@"FreeSql: FreeSql. Repository failed to set filter because object does not belong to IRepository";
/// <summary>
/// 不可比较,实体没有主键:{entityString}
/// </summary>
public static string Incomparable_EntityHasNo_PrimaryKey(object entityString) => string.Format(Language == "cn" ?
@"不可比较,实体没有主键:{0}" :
@"FreeSql: Not comparable, entity has no primary key: {0}", entityString);
/// <summary>
/// 不可比较,未设置主键的值:{entityString}
/// </summary>
public static string Incomparable_PrimaryKey_NotSet(object entityString) => string.Format(Language == "cn" ?
@"不可比较,未设置主键的值:{0}" :
@"FreeSql: Non-comparable, no value for primary key set: {0}", entityString);
/// <summary>
/// FreeSql.Repository Insert 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},插入的数据不符合 {entityString}
/// </summary>
public static string InsertError_Filter(object filterKey, object filterValueExpression, object entityString) => string.Format(Language == "cn" ?
@"FreeSql.Repository Insert 失败,因为设置了过滤器 {0}: {1},插入的数据不符合 {2}" :
@"FreeSql: FreeSql.Repository Insert failed because the filter {0}: {1} was set and the inserted data does not conform to {2}", filterKey, filterValueExpression, entityString);
/// <summary>
/// ISelect.AsType 参数不支持指定为 object
/// </summary>
public static string ISelectAsType_ParameterError => Language == "cn" ?
@"ISelect.AsType 参数不支持指定为 object" :
@"FreeSql: ISelect. AsType parameter does not support specifying as object";
/// <summary>
/// {tableTypeFullName} 不存在属性 {propertyName}
/// </summary>
public static string NotFound_Property(object propertyName, object tableTypeFullName) => string.Format(Language == "cn" ?
@"{1} 不存在属性 {0}" :
@"FreeSql: Property {0} does not exist for {1}", propertyName, tableTypeFullName);
/// <summary>
/// 找不到方法 DbSet&amp;lt;&amp;gt;.StatesRemoveByObjects
/// </summary>
public static string NotFoundMethod_StatesRemoveByObjects => Language == "cn" ?
@"找不到方法 DbSet<>.StatesRemoveByObjects" :
@"FreeSql: Method DbSet<> not found. StatesRemoveByObjects";
/// <summary>
/// 参数 data 类型错误 {entityTypeFullName}
/// </summary>
public static string ParameterDataTypeError(object entityTypeFullName) => string.Format(Language == "cn" ?
@"参数 data 类型错误 {0} " :
@"FreeSql: Parameter data type error {0}", entityTypeFullName);
/// <summary>
/// 参数错误 {param}
/// </summary>
public static string ParameterError(object param) => string.Format(Language == "cn" ?
@"参数错误 {0}" :
@"FreeSql: Parameter error {0}", param);
/// <summary>
/// 参数错误 {param} 不能为 null
/// </summary>
public static string ParameterError_CannotBeNull(object param) => string.Format(Language == "cn" ?
@"参数错误 {0} 不能为 null" :
@"FreeSql: Parameter error {0} cannot be null", param);
/// <summary>
/// 参数错误 {many} 不是集合属性
/// </summary>
public static string ParameterError_IsNot_CollectionProperties(object many) => string.Format(Language == "cn" ?
@"参数错误 {0} 不是集合属性" :
@"FreeSql: Parameter error {0} is not a collection property", many);
/// <summary>
/// 参数错误 {many} 集合属性不存在
/// </summary>
public static string ParameterError_NotFound_CollectionProperties(object many) => string.Format(Language == "cn" ?
@"参数错误 {0} 集合属性不存在" :
@"FreeSql: Parameter error {0} Collection property does not exist", many);
/// <summary>
/// 参数错误 {one} 属性不存在
/// </summary>
public static string ParameterError_NotFound_Property(object one) => string.Format(Language == "cn" ?
@"参数错误 {0} 属性不存在" :
@"FreeSql: Parameter error {0} attribute does not exist", one);
/// <summary>
/// Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常
/// </summary>
public static string Propagation_Mandatory => Language == "cn" ?
@"Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常" :
@"FreeSql: Propagation_ Mandatory: With the current transaction, throw an exception if there is no current transaction";
/// <summary>
/// Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常
/// </summary>
public static string Propagation_Never => Language == "cn" ?
@"Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常" :
@"FreeSql: Propagation_ Never: Perform the operation non-transactionally and throw an exception if the current transaction exists";
/// <summary>
/// {tableTypeFullName} 类型的属性 {propertyName} 不是 OneToMany 或 ManyToMany 特性
/// </summary>
public static string PropertyOfType_IsNot_OneToManyOrManyToMany(object propertyName, object tableTypeFullName) => string.Format(Language == "cn" ?
@"{1} 类型的属性 {0} 不是 OneToMany 或 ManyToMany 特性" :
@"FreeSql: Property {0} of type {1} is not OneToMany or ManyToMany attribute", propertyName, tableTypeFullName);
/// <summary>
/// 特别错误:批量添加失败,{dataType} 的返回数据,与添加的数目不匹配
/// </summary>
public static string SpecialError_BatchAdditionFailed(object dataType) => string.Format(Language == "cn" ?
@"特别错误:批量添加失败,{0} 的返回数据,与添加的数目不匹配" :
@"FreeSql: Special error: Bulk add failed, {0} returned data, does not match the number added", dataType);
/// <summary>
/// 特别错误:更新失败,数据未被跟踪:{entityString}
/// </summary>
public static string SpecialError_UpdateFailedDataNotTracked(object entityString) => string.Format(Language == "cn" ?
@"特别错误:更新失败,数据未被跟踪:{0}" :
@"FreeSql: Special error: Update failed, data not tracked: {0}", entityString);
/// <summary>
/// 已开启事务,不能禁用工作单元
/// </summary>
public static string TransactionHasBeenStarted => Language == "cn" ?
@"已开启事务,不能禁用工作单元" :
@"FreeSql: Transaction opened, unit of work cannot be disabled";
/// <summary>
/// {tableTypeFullName} 类型已设置属性 {propertyName} 忽略特性
/// </summary>
public static string TypeHasSetProperty_IgnoreAttribute(object tableTypeFullName, object propertyName) => string.Format(Language == "cn" ?
@"{0} 类型已设置属性 {1} 忽略特性" :
@"FreeSql: The {0} type has set the property {1} Ignore the attribute", tableTypeFullName, propertyName);
/// <summary>
/// {unitOfWorkManager} 构造参数 {fsql} 不能为 null
/// </summary>
public static string UnitOfWorkManager_Construction_CannotBeNull(object unitOfWorkManager, object fsql) => string.Format(Language == "cn" ?
@"{0} 构造参数 {1} 不能为 null" :
@"FreeSql: The {0} constructor parameter {1} cannot be null", unitOfWorkManager, fsql);
/// <summary>
/// FreeSql.Repository Update 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},更新的数据不符合{entityString}
/// </summary>
public static string UpdateError_Filter(object filterKey, object filterValueExpression, object entityString) => string.Format(Language == "cn" ?
@"FreeSql.Repository Update 失败,因为设置了过滤器 {0}: {1},更新的数据不符合{2}" :
@"FreeSql: FreeSql.Repository Update failed because the filter {0}: {1} is set and the updated data does not conform to {2}", filterKey, filterValueExpression, entityString);
}
}

View File

@@ -162,10 +162,10 @@ namespace FreeSql
/// <returns></returns>
public DbSet<TEntity> AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("DbSet"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("DbSet"));
if (entityType == _entityType) return this;
var newtb = _db.OrmOriginal.CodeFirst.GetTableByEntity(entityType);
_tablePriv = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("DbSet"));
_tablePriv = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("DbSet"));
_tableIdentitysPriv = null;
_tableReturnColumnsPriv = null;
_entityType = entityType;
@@ -220,7 +220,7 @@ namespace FreeSql
void AttachPriv(IEnumerable<TEntity> data, bool isAuditValue)
{
if (data == null || data.Any() == false) return;
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotAttach_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data.First())));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotAttach_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data.First())));
foreach (var item in data)
{
if (isAuditValue)
@@ -229,7 +229,7 @@ namespace FreeSql
_db.Options.AuditValue?.Invoke(new DbContextAuditValueEventArgs(Aop.AuditValueType.Update, _table.Type, item));
}
var key = _db.OrmOriginal.GetEntityKeyString(_entityType, item, false);
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextStrings.CannotAttach_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, item)));
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextErrorStrings.CannotAttach_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, item)));
_states.AddOrUpdate(key, k => CreateEntityState(item), (k, ov) =>
{
@@ -264,9 +264,9 @@ namespace FreeSql
public Dictionary<string, object[]> CompareState(TEntity newdata)
{
if (newdata == null) return null;
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.Incomparable_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, newdata)));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.Incomparable_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, newdata)));
var key = _db.OrmOriginal.GetEntityKeyString(_entityType, newdata, false);
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextStrings.Incomparable_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, newdata)));
if (string.IsNullOrEmpty(key)) throw new Exception(DbContextErrorStrings.Incomparable_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, newdata)));
if (_states.TryGetValue(key, out var oldState) == false || oldState == null)
return _table.ColumnsByCs.ToDictionary(a => a.Key, a => new object[]
{
@@ -326,7 +326,7 @@ namespace FreeSql
}
if (_table.Primarys.Any() == false)
{
if (isThrow) throw new Exception(DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
FreeSql.Internal.CommonProvider.InsertProvider<TEntity>.AuditDataValue(this, data, _db.OrmOriginal, _table, null);
@@ -350,7 +350,7 @@ namespace FreeSql
default:
if (_tableIdentitys.Length == 1 && _table.Primarys.Length == 1)
return true;
if (isThrow) throw new Exception(DbContextStrings.CannotAdd_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotAdd_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
}
@@ -359,14 +359,14 @@ namespace FreeSql
//不可添加,已存在于状态管理
//if (_states.ContainsKey(key))
//{
// if (isThrow) throw new Exception(DbContextStrings.CannotAdd_AlreadyExistsInStateManagement(_db.OrmOriginal.GetEntityString(_entityType, data)));
// if (isThrow) throw new Exception(DbContextErrorStrings.CannotAdd_AlreadyExistsInStateManagement(_db.OrmOriginal.GetEntityString(_entityType, data)));
// return false;
//}
if (_db.OrmOriginal.Ado.DataType == DataType.ClickHouse) return true;
var idval = _db.OrmOriginal.GetEntityIdentityValueWithPrimary(_entityType, data);
if (idval > 0)
{
if (isThrow) throw new Exception(DbContextStrings.CannotAdd_SelfIncreasingHasValue(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotAdd_SelfIncreasingHasValue(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
}
@@ -393,7 +393,7 @@ namespace FreeSql
}
if (_table.Primarys.Any() == false)
{
if (isThrow) throw new Exception(DbContextStrings.CannotUpdate_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotUpdate_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
FreeSql.Internal.CommonProvider.UpdateProvider<TEntity>.AuditDataValue(this, data, _db.OrmOriginal, _table, null);
@@ -401,12 +401,12 @@ namespace FreeSql
var key = _db.OrmOriginal.GetEntityKeyString(_entityType, data, false);
if (string.IsNullOrEmpty(key))
{
if (isThrow) throw new Exception(DbContextStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
if (_states.TryGetValue(key, out var tryval) == false)
{
if (isThrow) throw new Exception(DbContextStrings.CannotUpdate_DataShouldQueryOrAttach(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotUpdate_DataShouldQueryOrAttach(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
return true;
@@ -432,13 +432,13 @@ namespace FreeSql
}
if (_table.Primarys.Any() == false)
{
if (isThrow) throw new Exception(DbContextStrings.CannotDelete_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotDelete_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
var key = _db.OrmOriginal.GetEntityKeyString(_entityType, data, false);
if (string.IsNullOrEmpty(key))
{
if (isThrow) throw new Exception(DbContextStrings.CannotDelete_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (isThrow) throw new Exception(DbContextErrorStrings.CannotDelete_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
return false;
}
//if (_states.TryGetValue(key, out var tryval) == false) {

View File

@@ -119,7 +119,7 @@ namespace FreeSql
case DataType.DuckDB:
await DbContextFlushCommandAsync(cancellationToken);
var rets = await this.OrmInsert(data).ExecuteInsertedAsync(cancellationToken);
if (rets.Count != data.Count()) throw new Exception(DbContextStrings.SpecialError_BatchAdditionFailed(_db.OrmOriginal.Ado.DataType));
if (rets.Count != data.Count()) throw new Exception(DbContextErrorStrings.SpecialError_BatchAdditionFailed(_db.OrmOriginal.Ado.DataType));
_db._entityChangeReport.AddRange(rets.Select(a => new DbContext.EntityChangeReport.ChangeInfo { EntityType = _entityType, Object = a, Type = DbContext.EntityChangeType.Insert }));
var idx = 0;
foreach (var s in data)
@@ -321,7 +321,7 @@ namespace FreeSql
if (_states.TryGetValue(uplst1.Key, out var lstval1) == false) return -999;
var lstval2 = default(EntityState);
if (uplst2 != null && _states.TryGetValue(uplst2.Key, out lstval2) == false) throw new Exception(DbContextStrings.SpecialError_UpdateFailedDataNotTracked(_db.OrmOriginal.GetEntityString(_entityType, uplst2.Value)));
if (uplst2 != null && _states.TryGetValue(uplst2.Key, out lstval2) == false) throw new Exception(DbContextErrorStrings.SpecialError_UpdateFailedDataNotTracked(_db.OrmOriginal.GetEntityString(_entityType, uplst2.Value)));
var cuig1 = _db.OrmOriginal.CompareEntityValueReturnColumns(_entityType, uplst1.Value, lstval1.Value, true);
var cuig2 = uplst2 != null ? _db.OrmOriginal.CompareEntityValueReturnColumns(_entityType, uplst2.Value, lstval2.Value, true) : null;
@@ -373,11 +373,11 @@ namespace FreeSql
async public Task UpdateAsync(TEntity data, CancellationToken cancellationToken = default)
{
var exists = ExistsInStates(data);
if (exists == null) throw new Exception(DbContextStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (exists == null) throw new Exception(DbContextErrorStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (exists == false)
{
var olddata = await OrmSelect(data).FirstAsync(cancellationToken);
if (olddata == null) throw new Exception(DbContextStrings.CannotUpdate_RecordDoesNotExist(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (olddata == null) throw new Exception(DbContextErrorStrings.CannotUpdate_RecordDoesNotExist(_db.OrmOriginal.GetEntityString(_entityType, data)));
}
await UpdateRangePrivAsync(new[] { data }, true, cancellationToken);
@@ -442,7 +442,7 @@ namespace FreeSql
async public Task AddOrUpdateAsync(TEntity data, CancellationToken cancellationToken = default)
{
if (data == null) throw new ArgumentNullException(nameof(data));
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
var flagExists = ExistsInStates(data);
if (flagExists == false)

View File

@@ -122,7 +122,7 @@ namespace FreeSql
case DataType.DuckDB:
DbContextFlushCommand();
var rets = this.OrmInsert(data).ExecuteInserted();
if (rets.Count != data.Count()) throw new Exception(DbContextStrings.SpecialError_BatchAdditionFailed(_db.OrmOriginal.Ado.DataType));
if (rets.Count != data.Count()) throw new Exception(DbContextErrorStrings.SpecialError_BatchAdditionFailed(_db.OrmOriginal.Ado.DataType));
_db._entityChangeReport.AddRange(rets.Select(a => new DbContext.EntityChangeReport.ChangeInfo { EntityType = _entityType, Object = a, Type = DbContext.EntityChangeType.Insert }));
var idx = 0;
foreach (var s in data)
@@ -347,7 +347,7 @@ namespace FreeSql
if (_states.TryGetValue(uplst1.Key, out var lstval1) == false) return -999;
var lstval2 = default(EntityState);
if (uplst2 != null && _states.TryGetValue(uplst2.Key, out lstval2) == false) throw new Exception(DbContextStrings.SpecialError_UpdateFailedDataNotTracked(_db.OrmOriginal.GetEntityString(_entityType, uplst2.Value)));
if (uplst2 != null && _states.TryGetValue(uplst2.Key, out lstval2) == false) throw new Exception(DbContextErrorStrings.SpecialError_UpdateFailedDataNotTracked(_db.OrmOriginal.GetEntityString(_entityType, uplst2.Value)));
var cuig1 = _db.OrmOriginal.CompareEntityValueReturnColumns(_entityType, uplst1.Value, lstval1.Value, true);
var cuig2 = uplst2 != null ? _db.OrmOriginal.CompareEntityValueReturnColumns(_entityType, uplst2.Value, lstval2.Value, true) : null;
@@ -405,11 +405,11 @@ namespace FreeSql
public void Update(TEntity data)
{
var exists = ExistsInStates(data);
if (exists == null) throw new Exception(DbContextStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (exists == null) throw new Exception(DbContextErrorStrings.CannotUpdate_PrimaryKey_NotSet(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (exists == false)
{
var olddata = OrmSelect(data).First();
if (olddata == null) throw new Exception(DbContextStrings.CannotUpdate_RecordDoesNotExist(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (olddata == null) throw new Exception(DbContextErrorStrings.CannotUpdate_RecordDoesNotExist(_db.OrmOriginal.GetEntityString(_entityType, data)));
}
UpdateRangePriv(new[] { data }, true);
@@ -506,7 +506,7 @@ namespace FreeSql
public void AddOrUpdate(TEntity data)
{
if (data == null) throw new ArgumentNullException(nameof(data));
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data)));
var flagExists = ExistsInStates(data);
if (flagExists == false)
@@ -546,7 +546,7 @@ namespace FreeSql
public void BeginEdit(List<TEntity> data)
{
if (data == null) return;
if (_table.Primarys.Any() == false) throw new Exception(DbContextStrings.CannotEdit_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data.First())));
if (_table.Primarys.Any() == false) throw new Exception(DbContextErrorStrings.CannotEdit_EntityHasNo_PrimaryKey(_db.OrmOriginal.GetEntityString(_entityType, data.First())));
_statesEditing.Clear();
_dataEditing = data;
foreach (var item in data)
@@ -845,7 +845,7 @@ namespace FreeSql
var rawset = _db.Set(dbset.EntityType);
var statesRemove = typeof(DbSet<>).MakeGenericType(dbset.EntityType).GetMethod("StatesRemoveByObjects", BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(IEnumerable<object>) }, null);
if (statesRemove == null) throw new Exception(DbContextStrings.NotFoundMethod_StatesRemoveByObjects);
if (statesRemove == null) throw new Exception(DbContextErrorStrings.NotFoundMethod_StatesRemoveByObjects);
statesRemove.Invoke(rawset, new object[] { items });
}
returnDeleted?.AddRange(items);
@@ -866,8 +866,8 @@ namespace FreeSql
{
if (item == null) return;
if (string.IsNullOrEmpty(propertyName)) return;
if (_table.Properties.TryGetValue(propertyName, out var prop) == false) throw new KeyNotFoundException(DbContextStrings.NotFound_Property(_table.Type.FullName, propertyName));
if (_table.ColumnsByCsIgnore.ContainsKey(propertyName)) throw new ArgumentException(DbContextStrings.TypeHasSetProperty_IgnoreAttribute(_table.Type.FullName, propertyName));
if (_table.Properties.TryGetValue(propertyName, out var prop) == false) throw new KeyNotFoundException(DbContextErrorStrings.NotFound_Property(_table.Type.FullName, propertyName));
if (_table.ColumnsByCsIgnore.ContainsKey(propertyName)) throw new ArgumentException(DbContextErrorStrings.TypeHasSetProperty_IgnoreAttribute(_table.Type.FullName, propertyName));
var tref = _table.GetTableRef(propertyName, true, false);
if (tref == null) return;
@@ -876,7 +876,7 @@ namespace FreeSql
case TableRefType.OneToOne:
case TableRefType.ManyToOne:
case TableRefType.PgArrayToMany:
throw new ArgumentException(DbContextStrings.PropertyOfType_IsNot_OneToManyOrManyToMany(_table.Type.FullName, propertyName));
throw new ArgumentException(DbContextErrorStrings.PropertyOfType_IsNot_OneToManyOrManyToMany(_table.Type.FullName, propertyName));
}
DbContextFlushCommand();

View File

@@ -42,7 +42,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
#region HasKey
public EfCoreTableFluent HasKey(string key)
{
if (key == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("key"));
if (key == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("key"));
foreach (string name in key.Split(','))
{
if (string.IsNullOrEmpty(name.Trim())) continue;
@@ -55,7 +55,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
#region HasIndex
public HasIndexFluent HasIndex(string index)
{
if (index == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("index"));
if (index == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("index"));
var indexName = $"idx_{Guid.NewGuid().ToString("N").Substring(0, 8)}";
var columns = new List<string>();
foreach (string name in index.Split(','))
@@ -98,8 +98,8 @@ namespace FreeSql.Extensions.EfCoreFluentApi
#region HasOne
public HasOneFluent HasOne(string one)
{
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (_entityType.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(one));
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
if (_entityType.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(one));
return new HasOneFluent(_fsql, _tf, _entityType, oneProperty.PropertyType, one);
}
public class HasOneFluent
@@ -124,8 +124,8 @@ namespace FreeSql.Extensions.EfCoreFluentApi
}
public HasOneFluent WithMany(string many)
{
if (many == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(many));
if (many == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(many));
_withManyProperty = manyProperty.Name;
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity(_entityType2, eb2 => eb2.Navigate(many, _selfBind));
@@ -133,18 +133,18 @@ namespace FreeSql.Extensions.EfCoreFluentApi
}
public HasOneFluent WithOne(string one, string foreignKey)
{
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (_entityType1.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(one));
if (oneProperty != _entityType1) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(one));
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
if (_entityType1.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(one));
if (oneProperty != _entityType1) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(one));
_withOneProperty = oneProperty.Name;
if (foreignKey == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (foreignKey == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
foreach (string name in foreignKey.Split(','))
{
if (string.IsNullOrEmpty(name.Trim())) continue;
_withOneBind += ", " + name.Trim();
}
if (string.IsNullOrEmpty(_withOneBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_withOneBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
_withOneBind = _withOneBind.TrimStart(',', ' ');
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity(_entityType2, eb2 => eb2.Navigate(_withOneProperty, _withOneBind));
@@ -152,13 +152,13 @@ namespace FreeSql.Extensions.EfCoreFluentApi
}
public HasOneFluent HasForeignKey(string foreignKey)
{
if (foreignKey == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (foreignKey == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
foreach (string name in foreignKey.Split(','))
{
if (string.IsNullOrEmpty(name.Trim())) continue;
_selfBind += ", " + name.Trim();
}
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
_selfBind = _selfBind.TrimStart(',', ' ');
_tf.Navigate(_selfProperty, _selfBind);
if (string.IsNullOrEmpty(_withManyProperty) == false)
@@ -173,9 +173,9 @@ namespace FreeSql.Extensions.EfCoreFluentApi
#region HasMany
public HasManyFluent HasMany(string many)
{
if (string.IsNullOrEmpty(many)) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (_entityType.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_CollectionProperties(many));
if (typeof(IEnumerable).IsAssignableFrom(manyProperty.PropertyType) == false || manyProperty.PropertyType.IsGenericType == false) throw new ArgumentException(DbContextStrings.ParameterError_IsNot_CollectionProperties(many));
if (string.IsNullOrEmpty(many)) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
if (_entityType.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_CollectionProperties(many));
if (typeof(IEnumerable).IsAssignableFrom(manyProperty.PropertyType) == false || manyProperty.PropertyType.IsGenericType == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_IsNot_CollectionProperties(many));
return new HasManyFluent(_fsql, _tf, _entityType, manyProperty.PropertyType.GetGenericArguments()[0], manyProperty.Name);
}
public class HasManyFluent
@@ -200,18 +200,18 @@ namespace FreeSql.Extensions.EfCoreFluentApi
public void WithMany(string many, Type middleType)
{
if (string.IsNullOrEmpty(many)) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_CollectionProperties(many));
if (typeof(IEnumerable).IsAssignableFrom(manyProperty.PropertyType) == false || manyProperty.PropertyType.IsGenericType == false) throw new ArgumentException(DbContextStrings.ParameterError_IsNot_CollectionProperties(many));
if (string.IsNullOrEmpty(many)) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(many, out var manyProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_CollectionProperties(many));
if (typeof(IEnumerable).IsAssignableFrom(manyProperty.PropertyType) == false || manyProperty.PropertyType.IsGenericType == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_IsNot_CollectionProperties(many));
_withManyProperty = manyProperty.Name;
_tf.Navigate(_selfProperty, null, middleType);
_fsql.CodeFirst.ConfigEntity(_entityType2, eb2 => eb2.Navigate(_withManyProperty, null, middleType));
}
public HasManyFluent WithOne(string one)
{
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(one));
if (oneProperty.PropertyType != _entityType1) throw new ArgumentException(DbContextStrings.ParameterError_NotFound_Property(one));
if (string.IsNullOrEmpty(one)) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
if (_entityType2.GetPropertiesDictIgnoreCase().TryGetValue(one, out var oneProperty) == false) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(one));
if (oneProperty.PropertyType != _entityType1) throw new ArgumentException(DbContextErrorStrings.ParameterError_NotFound_Property(one));
_withOneProperty = oneProperty.Name;
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity(_entityType2, eb2 => eb2.Navigate(oneProperty.Name, _selfBind));
@@ -219,13 +219,13 @@ namespace FreeSql.Extensions.EfCoreFluentApi
}
public HasManyFluent HasForeignKey(string foreignKey)
{
if (foreignKey == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (foreignKey == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
foreach (string name in foreignKey.Split(','))
{
if (string.IsNullOrEmpty(name.Trim())) continue;
_selfBind += ", " + name.Trim();
}
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
_selfBind = _selfBind.TrimStart(',', ' ');
_tf.Navigate(_selfProperty, _selfBind);
if (string.IsNullOrEmpty(_withOneProperty) == false)

View File

@@ -42,7 +42,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = key?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("key"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("key"));
switch (exp.NodeType)
{
@@ -63,7 +63,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = index?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("index"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("index"));
var indexName = $"idx_{Guid.NewGuid().ToString("N").Substring(0, 8)}";
var columns = new List<string>();
@@ -114,7 +114,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = one?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
var oneProperty = "";
switch (exp.NodeType)
@@ -123,7 +123,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
oneProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(oneProperty)) throw new ArgumentException(DbContextStrings.ParameterError("one"));
if (string.IsNullOrEmpty(oneProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("one"));
return new HasOneFluent<T2>(_fsql, _tf, oneProperty);
}
public class HasOneFluent<T2>
@@ -146,7 +146,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = many?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
switch (exp.NodeType)
{
@@ -154,7 +154,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_withManyProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(_withManyProperty)) throw new ArgumentException(DbContextStrings.ParameterError("many"));
if (string.IsNullOrEmpty(_withManyProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("many"));
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withManyProperty, _selfBind));
return this;
@@ -163,7 +163,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = one?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
switch (exp.NodeType)
{
@@ -171,11 +171,11 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_withOneProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(_withOneProperty)) throw new ArgumentException(DbContextStrings.ParameterError("one"));
if (string.IsNullOrEmpty(_withOneProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("one"));
exp = foreignKey?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
switch (exp.NodeType)
{
@@ -190,7 +190,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_withOneBind = _withOneBind.TrimStart(',', ' ');
break;
}
if (string.IsNullOrEmpty(_withOneBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_withOneBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withOneProperty, _withOneBind));
return this;
@@ -199,7 +199,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = foreignKey?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
switch (exp.NodeType)
{
@@ -214,7 +214,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_selfBind = _selfBind.TrimStart(',', ' ');
break;
}
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
_tf.Navigate(_selfProperty, _selfBind);
if (string.IsNullOrEmpty(_withManyProperty) == false)
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withManyProperty, _selfBind));
@@ -230,7 +230,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = many?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
var manyProperty = "";
switch (exp.NodeType)
@@ -239,7 +239,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
manyProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(manyProperty)) throw new ArgumentException(DbContextStrings.ParameterError("many"));
if (string.IsNullOrEmpty(manyProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("many"));
return new HasManyFluent<T2>(_fsql, _tf, manyProperty);
}
public class HasManyFluent<T2>
@@ -262,7 +262,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = many?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("many"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("many"));
switch (exp.NodeType)
{
@@ -270,7 +270,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_withManyProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(_withManyProperty)) throw new ArgumentException(DbContextStrings.ParameterError("many"));
if (string.IsNullOrEmpty(_withManyProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("many"));
_tf.Navigate(_selfProperty, null, middleType);
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withManyProperty, null, middleType));
@@ -279,7 +279,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = one?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("one"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("one"));
switch (exp.NodeType)
{
@@ -287,7 +287,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_withOneProperty = (exp as MemberExpression).Member.Name;
break;
}
if (string.IsNullOrEmpty(_withOneProperty)) throw new ArgumentException(DbContextStrings.ParameterError("one"));
if (string.IsNullOrEmpty(_withOneProperty)) throw new ArgumentException(DbContextErrorStrings.ParameterError("one"));
if (string.IsNullOrEmpty(_selfBind) == false)
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withOneProperty, _selfBind));
@@ -297,7 +297,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
{
var exp = foreignKey?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
if (exp == null) throw new ArgumentException(DbContextStrings.ParameterError_CannotBeNull("foreignKey"));
if (exp == null) throw new ArgumentException(DbContextErrorStrings.ParameterError_CannotBeNull("foreignKey"));
switch (exp.NodeType)
{
@@ -312,7 +312,7 @@ namespace FreeSql.Extensions.EfCoreFluentApi
_selfBind = _selfBind.TrimStart(',', ' ');
break;
}
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextStrings.ParameterError("foreignKey"));
if (string.IsNullOrEmpty(_selfBind)) throw new ArgumentException(DbContextErrorStrings.ParameterError("foreignKey"));
_tf.Navigate(_selfProperty, _selfBind);
if (string.IsNullOrEmpty(_withOneProperty) == false)
_fsql.CodeFirst.ConfigEntity<T2>(eb2 => eb2.Navigate(_withOneProperty, _selfBind));

View File

@@ -21,7 +21,7 @@ namespace Microsoft.Extensions.DependencyInjection
}
catch(Exception ex)
{
throw new Exception(DbContextStrings.AddFreeDbContextError_CheckConstruction(dbContextType.Name), ex);
throw new Exception(DbContextErrorStrings.AddFreeDbContextError_CheckConstruction(dbContextType.Name), ex);
}
if (ctx != null && ctx._ormScoped == null)
{
@@ -31,7 +31,7 @@ namespace Microsoft.Extensions.DependencyInjection
ctx._optionsPriv = builder._options;
if (ctx._ormScoped == null)
throw new Exception(DbContextStrings.ConfigureUseFreeSql);
throw new Exception(DbContextErrorStrings.ConfigureUseFreeSql);
ctx.InitPropSets();
}

View File

@@ -63,26 +63,4 @@
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\DbContextStrings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>DbContextStrings.Designer.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\DbContextStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>DbContextStrings.Designer.cs</LastGenOutput>
</None>
<EmbeddedResource Update="Properties\DbContextStrings.resx">
<SubType>Designer</SubType>
<CustomToolNamespace>FreeSql</CustomToolNamespace>
</EmbeddedResource>
<EmbeddedResource Update="Properties\DbContextStrings.zh-Hans.resx">
<CustomToolNamespace>FreeSql</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -83,6 +83,216 @@
刷新队列中的命令
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.AddFreeDbContextError_CheckConstruction(System.Object)">
<summary>
AddFreeDbContext 发生错误,请检查 {dbContextTypeName} 的构造参数都已正确注入
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAdd_AlreadyExistsInStateManagement(System.Object)">
<summary>
不可添加,已存在于状态管理:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAdd_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可添加,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAdd_PrimaryKey_NotSet(System.Object)">
<summary>
不可添加,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAdd_SelfIncreasingHasValue(System.Object)">
<summary>
不可添加,自增属性有值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAttach_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可附加,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotAttach_PrimaryKey_NotSet(System.Object)">
<summary>
不可附加,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotDelete_DataNotTracked_ShouldQuery(System.Object)">
<summary>
不可删除,数据未被跟踪,应该先查询:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotDelete_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可删除,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotDelete_PrimaryKey_NotSet(System.Object)">
<summary>
不可删除,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotEdit_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可进行编辑,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotUpdate_DataShouldQueryOrAttach(System.Object)">
<summary>
不可更新,数据未被跟踪,应该先查询 或者 Attach{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotUpdate_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可更新,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotUpdate_PrimaryKey_NotSet(System.Object)">
<summary>
不可更新,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.CannotUpdate_RecordDoesNotExist(System.Object)">
<summary>
不可更新,数据库不存在该记录:{entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.ConfigureUseFreeSql">
<summary>
请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.DbSetAsType_NotSupport_Object">
<summary>
DbSet.AsType 参数错误,请传入正确的实体类型
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.EntityType_CannotConvert(System.Object,System.Object)">
<summary>
实体类型 {EntityTypeName} 无法转换为 {name},无法使用该方法
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.EntityType_PrimaryKeyError(System.Object,System.Object)">
<summary>
实体类型 {EntityTypeName} 主键类型不为 {fullName},无法使用该方法
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.EntityType_PrimaryKeyIsNotOne(System.Object)">
<summary>
实体类型 {EntityTypeName} 主键数量不为 1无法使用该方法
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.FailedSetFilter_NotBelongIRpository">
<summary>
FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.Incomparable_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可比较,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.Incomparable_PrimaryKey_NotSet(System.Object)">
<summary>
不可比较,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.InsertError_Filter(System.Object,System.Object,System.Object)">
<summary>
FreeSql.Repository Insert 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},插入的数据不符合 {entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.ISelectAsType_ParameterError">
<summary>
ISelect.AsType 参数不支持指定为 object
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.NotFound_Property(System.Object,System.Object)">
<summary>
{tableTypeFullName} 不存在属性 {propertyName}
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.NotFoundMethod_StatesRemoveByObjects">
<summary>
找不到方法 DbSet&amp;lt;&amp;gt;.StatesRemoveByObjects
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterDataTypeError(System.Object)">
<summary>
参数 data 类型错误 {entityTypeFullName}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterError(System.Object)">
<summary>
参数错误 {param}
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterError_CannotBeNull(System.Object)">
<summary>
参数错误 {param} 不能为 null
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterError_IsNot_CollectionProperties(System.Object)">
<summary>
参数错误 {many} 不是集合属性
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterError_NotFound_CollectionProperties(System.Object)">
<summary>
参数错误 {many} 集合属性不存在
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.ParameterError_NotFound_Property(System.Object)">
<summary>
参数错误 {one} 属性不存在
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.Propagation_Mandatory">
<summary>
Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.Propagation_Never">
<summary>
Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.PropertyOfType_IsNot_OneToManyOrManyToMany(System.Object,System.Object)">
<summary>
{tableTypeFullName} 类型的属性 {propertyName} 不是 OneToMany 或 ManyToMany 特性
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.SpecialError_BatchAdditionFailed(System.Object)">
<summary>
特别错误:批量添加失败,{dataType} 的返回数据,与添加的数目不匹配
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.SpecialError_UpdateFailedDataNotTracked(System.Object)">
<summary>
特别错误:更新失败,数据未被跟踪:{entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextErrorStrings.TransactionHasBeenStarted">
<summary>
已开启事务,不能禁用工作单元
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.TypeHasSetProperty_IgnoreAttribute(System.Object,System.Object)">
<summary>
{tableTypeFullName} 类型已设置属性 {propertyName} 忽略特性
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.UnitOfWorkManager_Construction_CannotBeNull(System.Object,System.Object)">
<summary>
{unitOfWorkManager} 构造参数 {fsql} 不能为 null
</summary>
</member>
<member name="M:FreeSql.DbContextErrorStrings.UpdateError_Filter(System.Object,System.Object,System.Object)">
<summary>
FreeSql.Repository Update 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},更新的数据不符合{entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextOptions.EnableCascadeSave">
<summary>
是否开启 一对一(OneToOne)、一对多(OneToMany)、多对多(ManyToMany) 级联保存功能<para></para>
@@ -264,233 +474,6 @@
<param name="data"></param>
<returns></returns>
</member>
<member name="T:FreeSql.DbContextStrings">
<summary>
<para>
String resources used in FreeSql exceptions, etc.
</para>
<para>
These strings are exposed publicly for use by database providers and extensions.
It is unusual for application code to need these strings.
</para>
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.Culture">
<summary>
重写当前线程的 CurrentUICulture 属性,对
使用此强类型资源类的所有资源查找执行重写。
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.AddFreeDbContextError_CheckConstruction(System.Object)">
<summary>
AddFreeDbContext 发生错误,请检查 {dbContextTypeName} 的构造参数都已正确注入
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAdd_AlreadyExistsInStateManagement(System.Object)">
<summary>
不可添加,已存在于状态管理:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAdd_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可添加,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAdd_PrimaryKey_NotSet(System.Object)">
<summary>
不可添加,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAdd_SelfIncreasingHasValue(System.Object)">
<summary>
不可添加,自增属性有值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAttach_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可附加,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotAttach_PrimaryKey_NotSet(System.Object)">
<summary>
不可附加,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotDelete_DataNotTracked_ShouldQuery(System.Object)">
<summary>
不可删除,数据未被跟踪,应该先查询:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotDelete_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可删除,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotDelete_PrimaryKey_NotSet(System.Object)">
<summary>
不可删除,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotEdit_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可进行编辑,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotUpdate_DataShouldQueryOrAttach(System.Object)">
<summary>
不可更新,数据未被跟踪,应该先查询 或者 Attach{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotUpdate_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可更新,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotUpdate_PrimaryKey_NotSet(System.Object)">
<summary>
不可更新,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.CannotUpdate_RecordDoesNotExist(System.Object)">
<summary>
不可更新,数据库不存在该记录:{entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.ConfigureUseFreeSql">
<summary>
请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.DbSetAsType_NotSupport_Object">
<summary>
DbSet.AsType 参数错误,请传入正确的实体类型
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.EntityType_CannotConvert(System.Object,System.Object)">
<summary>
实体类型 {EntityTypeName} 无法转换为 {name},无法使用该方法
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.EntityType_PrimaryKeyError(System.Object,System.Object)">
<summary>
实体类型 {EntityTypeName} 主键类型不为 {fullName},无法使用该方法
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.EntityType_PrimaryKeyIsNotOne(System.Object)">
<summary>
实体类型 {EntityTypeName} 主键数量不为 1无法使用该方法
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.FailedSetFilter_NotBelongIRpository">
<summary>
FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.Incomparable_EntityHasNo_PrimaryKey(System.Object)">
<summary>
不可比较,实体没有主键:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.Incomparable_PrimaryKey_NotSet(System.Object)">
<summary>
不可比较,未设置主键的值:{entityString}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.InsertError_Filter(System.Object,System.Object,System.Object)">
<summary>
FreeSql.Repository Insert 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},插入的数据不符合 {entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.ISelectAsType_ParameterError">
<summary>
ISelect.AsType 参数不支持指定为 object
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.NotFound_Property(System.Object,System.Object)">
<summary>
{tableTypeFullName} 不存在属性 {propertyName}
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.NotFoundMethod_StatesRemoveByObjects">
<summary>
找不到方法 DbSet&lt;&gt;.StatesRemoveByObjects
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterDataTypeError(System.Object)">
<summary>
参数 data 类型错误 {entityTypeFullName}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterError(System.Object)">
<summary>
参数错误 {param}
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterError_CannotBeNull(System.Object)">
<summary>
参数错误 {param} 不能为 null
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterError_IsNot_CollectionProperties(System.Object)">
<summary>
参数错误 {many} 不是集合属性
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterError_NotFound_CollectionProperties(System.Object)">
<summary>
参数错误 {many} 集合属性不存在
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.ParameterError_NotFound_Property(System.Object)">
<summary>
参数错误 {one} 属性不存在
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.Propagation_Mandatory">
<summary>
Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.Propagation_Never">
<summary>
Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.PropertyOfType_IsNot_OneToManyOrManyToMany(System.Object,System.Object)">
<summary>
{tableTypeFullName} 类型的属性 {propertyName} 不是 OneToMany 或 ManyToMany 特性
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.SpecialError_BatchAdditionFailed(System.Object)">
<summary>
特别错误:批量添加失败,{dataType} 的返回数据,与添加的数目不匹配
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.SpecialError_UpdateFailedDataNotTracked(System.Object)">
<summary>
特别错误:更新失败,数据未被跟踪:{entityString}
</summary>
</member>
<member name="P:FreeSql.DbContextStrings.TransactionHasBeenStarted">
<summary>
已开启事务,不能禁用工作单元
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.TypeHasSetProperty_IgnoreAttribute(System.Object,System.Object)">
<summary>
{tableTypeFullName} 类型已设置属性 {propertyName} 忽略特性
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.UnitOfWorkManager_Construction_CannotBeNull(System.Object,System.Object)">
<summary>
{unitOfWorkManager} 构造参数 {fsql} 不能为 null
</summary>
</member>
<member name="M:FreeSql.DbContextStrings.UpdateError_Filter(System.Object,System.Object,System.Object)">
<summary>
FreeSql.Repository Update 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},更新的数据不符合{entityString}
</summary>
</member>
<member name="M:FreeSql.IRepositoryUnitOfWork.GetRepository``1">
<summary>
在工作单元内创建联合主键的仓储类,工作单元下的仓储操作具有事务特点

View File

@@ -1,375 +0,0 @@

// <auto-generated />
using System;
using System.Reflection;
using System.Resources;
using System.Globalization;
using System.Threading;
namespace FreeSql
{
/// <summary>
/// <para>
/// String resources used in FreeSql exceptions, etc.
/// </para>
/// <para>
/// These strings are exposed publicly for use by database providers and extensions.
/// It is unusual for application code to need these strings.
/// </para>
/// </summary>
public static class DbContextStrings
{
private static readonly ResourceManager _resourceManager = new ResourceManager("FreeSql.DbContext.Properties.DbContextStrings", typeof(DbContextStrings).Assembly);
private static CultureInfo _resourceCulture;
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
public static CultureInfo Culture
{
get
{
return _resourceCulture;
}
set
{
_resourceCulture = value;
}
}
/// <summary>
/// AddFreeDbContext 发生错误,请检查 {dbContextTypeName} 的构造参数都已正确注入
/// </summary>
public static string AddFreeDbContextError_CheckConstruction(object dbContextTypeName)
=> string.Format(
GetString("AddFreeDbContextError_CheckConstruction", nameof(dbContextTypeName)),
dbContextTypeName);
/// <summary>
/// 不可添加,已存在于状态管理:{entityString}
/// </summary>
public static string CannotAdd_AlreadyExistsInStateManagement(object entityString)
=> string.Format(
GetString("CannotAdd_AlreadyExistsInStateManagement", nameof(entityString)),
entityString);
/// <summary>
/// 不可添加,实体没有主键:{entityString}
/// </summary>
public static string CannotAdd_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("CannotAdd_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可添加,未设置主键的值:{entityString}
/// </summary>
public static string CannotAdd_PrimaryKey_NotSet(object entityString)
=> string.Format(
GetString("CannotAdd_PrimaryKey_NotSet", nameof(entityString)),
entityString);
/// <summary>
/// 不可添加,自增属性有值:{entityString}
/// </summary>
public static string CannotAdd_SelfIncreasingHasValue(object entityString)
=> string.Format(
GetString("CannotAdd_SelfIncreasingHasValue", nameof(entityString)),
entityString);
/// <summary>
/// 不可附加,实体没有主键:{entityString}
/// </summary>
public static string CannotAttach_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("CannotAttach_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可附加,未设置主键的值:{entityString}
/// </summary>
public static string CannotAttach_PrimaryKey_NotSet(object entityString)
=> string.Format(
GetString("CannotAttach_PrimaryKey_NotSet", nameof(entityString)),
entityString);
/// <summary>
/// 不可删除,数据未被跟踪,应该先查询:{entityString}
/// </summary>
public static string CannotDelete_DataNotTracked_ShouldQuery(object entityString)
=> string.Format(
GetString("CannotDelete_DataNotTracked_ShouldQuery", nameof(entityString)),
entityString);
/// <summary>
/// 不可删除,实体没有主键:{entityString}
/// </summary>
public static string CannotDelete_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("CannotDelete_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可删除,未设置主键的值:{entityString}
/// </summary>
public static string CannotDelete_PrimaryKey_NotSet(object entityString)
=> string.Format(
GetString("CannotDelete_PrimaryKey_NotSet", nameof(entityString)),
entityString);
/// <summary>
/// 不可进行编辑,实体没有主键:{entityString}
/// </summary>
public static string CannotEdit_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("CannotEdit_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可更新,数据未被跟踪,应该先查询 或者 Attach{entityString}
/// </summary>
public static string CannotUpdate_DataShouldQueryOrAttach(object entityString)
=> string.Format(
GetString("CannotUpdate_DataShouldQueryOrAttach", nameof(entityString)),
entityString);
/// <summary>
/// 不可更新,实体没有主键:{entityString}
/// </summary>
public static string CannotUpdate_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("CannotUpdate_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可更新,未设置主键的值:{entityString}
/// </summary>
public static string CannotUpdate_PrimaryKey_NotSet(object entityString)
=> string.Format(
GetString("CannotUpdate_PrimaryKey_NotSet", nameof(entityString)),
entityString);
/// <summary>
/// 不可更新,数据库不存在该记录:{entityString}
/// </summary>
public static string CannotUpdate_RecordDoesNotExist(object entityString)
=> string.Format(
GetString("CannotUpdate_RecordDoesNotExist", nameof(entityString)),
entityString);
/// <summary>
/// 请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql
/// </summary>
public static string ConfigureUseFreeSql
=> GetString("ConfigureUseFreeSql");
/// <summary>
/// DbSet.AsType 参数错误,请传入正确的实体类型
/// </summary>
public static string DbSetAsType_NotSupport_Object
=> GetString("DbSetAsType_NotSupport_Object");
/// <summary>
/// 实体类型 {EntityTypeName} 无法转换为 {name},无法使用该方法
/// </summary>
public static string EntityType_CannotConvert(object EntityTypeName, object name)
=> string.Format(
GetString("EntityType_CannotConvert", nameof(EntityTypeName), nameof(name)),
EntityTypeName, name);
/// <summary>
/// 实体类型 {EntityTypeName} 主键类型不为 {fullName},无法使用该方法
/// </summary>
public static string EntityType_PrimaryKeyError(object EntityTypeName, object fullName)
=> string.Format(
GetString("EntityType_PrimaryKeyError", nameof(EntityTypeName), nameof(fullName)),
EntityTypeName, fullName);
/// <summary>
/// 实体类型 {EntityTypeName} 主键数量不为 1无法使用该方法
/// </summary>
public static string EntityType_PrimaryKeyIsNotOne(object EntityTypeName)
=> string.Format(
GetString("EntityType_PrimaryKeyIsNotOne", nameof(EntityTypeName)),
EntityTypeName);
/// <summary>
/// FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository
/// </summary>
public static string FailedSetFilter_NotBelongIRpository
=> GetString("FailedSetFilter_NotBelongIRpository");
/// <summary>
/// 不可比较,实体没有主键:{entityString}
/// </summary>
public static string Incomparable_EntityHasNo_PrimaryKey(object entityString)
=> string.Format(
GetString("Incomparable_EntityHasNo_PrimaryKey", nameof(entityString)),
entityString);
/// <summary>
/// 不可比较,未设置主键的值:{entityString}
/// </summary>
public static string Incomparable_PrimaryKey_NotSet(object entityString)
=> string.Format(
GetString("Incomparable_PrimaryKey_NotSet", nameof(entityString)),
entityString);
/// <summary>
/// FreeSql.Repository Insert 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},插入的数据不符合 {entityString}
/// </summary>
public static string InsertError_Filter(object filterKey, object filterValueExpression, object entityString)
=> string.Format(
GetString("InsertError_Filter", nameof(filterKey), nameof(filterValueExpression), nameof(entityString)),
filterKey, filterValueExpression, entityString);
/// <summary>
/// ISelect.AsType 参数不支持指定为 object
/// </summary>
public static string ISelectAsType_ParameterError
=> GetString("ISelectAsType_ParameterError");
/// <summary>
/// {tableTypeFullName} 不存在属性 {propertyName}
/// </summary>
public static string NotFound_Property(object tableTypeFullName, object propertyName)
=> string.Format(
GetString("NotFound_Property", nameof(tableTypeFullName), nameof(propertyName)),
tableTypeFullName, propertyName);
/// <summary>
/// 找不到方法 DbSet&lt;&gt;.StatesRemoveByObjects
/// </summary>
public static string NotFoundMethod_StatesRemoveByObjects
=> GetString("NotFoundMethod_StatesRemoveByObjects");
/// <summary>
/// 参数 data 类型错误 {entityTypeFullName}
/// </summary>
public static string ParameterDataTypeError(object entityTypeFullName)
=> string.Format(
GetString("ParameterDataTypeError", nameof(entityTypeFullName)),
entityTypeFullName);
/// <summary>
/// 参数错误 {param}
/// </summary>
public static string ParameterError(object param)
=> string.Format(
GetString("ParameterError", nameof(param)),
param);
/// <summary>
/// 参数错误 {param} 不能为 null
/// </summary>
public static string ParameterError_CannotBeNull(object param)
=> string.Format(
GetString("ParameterError_CannotBeNull", nameof(param)),
param);
/// <summary>
/// 参数错误 {many} 不是集合属性
/// </summary>
public static string ParameterError_IsNot_CollectionProperties(object many)
=> string.Format(
GetString("ParameterError_IsNot_CollectionProperties", nameof(many)),
many);
/// <summary>
/// 参数错误 {many} 集合属性不存在
/// </summary>
public static string ParameterError_NotFound_CollectionProperties(object many)
=> string.Format(
GetString("ParameterError_NotFound_CollectionProperties", nameof(many)),
many);
/// <summary>
/// 参数错误 {one} 属性不存在
/// </summary>
public static string ParameterError_NotFound_Property(object one)
=> string.Format(
GetString("ParameterError_NotFound_Property", nameof(one)),
one);
/// <summary>
/// Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常
/// </summary>
public static string Propagation_Mandatory
=> GetString("Propagation_Mandatory");
/// <summary>
/// Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常
/// </summary>
public static string Propagation_Never
=> GetString("Propagation_Never");
/// <summary>
/// {tableTypeFullName} 类型的属性 {propertyName} 不是 OneToMany 或 ManyToMany 特性
/// </summary>
public static string PropertyOfType_IsNot_OneToManyOrManyToMany(object tableTypeFullName, object propertyName)
=> string.Format(
GetString("PropertyOfType_IsNot_OneToManyOrManyToMany", nameof(tableTypeFullName), nameof(propertyName)),
tableTypeFullName, propertyName);
/// <summary>
/// 特别错误:批量添加失败,{dataType} 的返回数据,与添加的数目不匹配
/// </summary>
public static string SpecialError_BatchAdditionFailed(object dataType)
=> string.Format(
GetString("SpecialError_BatchAdditionFailed", nameof(dataType)),
dataType);
/// <summary>
/// 特别错误:更新失败,数据未被跟踪:{entityString}
/// </summary>
public static string SpecialError_UpdateFailedDataNotTracked(object entityString)
=> string.Format(
GetString("SpecialError_UpdateFailedDataNotTracked", nameof(entityString)),
entityString);
/// <summary>
/// 已开启事务,不能禁用工作单元
/// </summary>
public static string TransactionHasBeenStarted
=> GetString("TransactionHasBeenStarted");
/// <summary>
/// {tableTypeFullName} 类型已设置属性 {propertyName} 忽略特性
/// </summary>
public static string TypeHasSetProperty_IgnoreAttribute(object tableTypeFullName, object propertyName)
=> string.Format(
GetString("TypeHasSetProperty_IgnoreAttribute", nameof(tableTypeFullName), nameof(propertyName)),
tableTypeFullName, propertyName);
/// <summary>
/// {unitOfWorkManager} 构造参数 {fsql} 不能为 null
/// </summary>
public static string UnitOfWorkManager_Construction_CannotBeNull(object unitOfWorkManager, object fsql)
=> string.Format(
GetString("UnitOfWorkManager_Construction_CannotBeNull", nameof(unitOfWorkManager), nameof(fsql)),
unitOfWorkManager, fsql);
/// <summary>
/// FreeSql.Repository Update 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},更新的数据不符合{entityString}
/// </summary>
public static string UpdateError_Filter(object filterKey, object filterValueExpression, object entityString)
=> string.Format(
GetString("UpdateError_Filter", nameof(filterKey), nameof(filterValueExpression), nameof(entityString)),
filterKey, filterValueExpression, entityString);
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name,_resourceCulture);
for (var i = 0; i < formatterNames.Length; i++)
{
value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}");
}
return value;
}
}
}

View File

@@ -1,5 +0,0 @@
<#
Session["ResourceFile"] = "DbContextStrings.resx";
Session["AccessModifier"] = "public";
#>
<#@ include file="../../FreeSql/Properties/Resources.tt" #>

View File

@@ -1,246 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddFreeDbContextError_CheckConstruction" xml:space="preserve">
<value>FreeSql: An error occurred in AddFreeDbContext, check that the construction parameters of {dbContextTypeName} have been injected correctly</value>
</data>
<data name="CannotAdd_AlreadyExistsInStateManagement" xml:space="preserve">
<value>FreeSql: Not addable, already exists in state management: {entityString}</value>
</data>
<data name="CannotAdd_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not addable, entity has no primary key: {entityString}</value>
</data>
<data name="CannotAdd_PrimaryKey_NotSet" xml:space="preserve">
<value>FreeSql: Not addable, no value for primary key set: {entityString}</value>
</data>
<data name="CannotAdd_SelfIncreasingHasValue" xml:space="preserve">
<value>FreeSql: Not addable, self-increasing attribute has value: {entityString}</value>
</data>
<data name="CannotAttach_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not attachable, entity has no primary key: {entityString}</value>
</data>
<data name="CannotAttach_PrimaryKey_NotSet" xml:space="preserve">
<value>FreeSql: Not attachable, no value for primary key set: {entityString}</value>
</data>
<data name="CannotDelete_DataNotTracked_ShouldQuery" xml:space="preserve">
<value>FreeSql: Not deletable, data not tracked, should query first: {entityString}</value>
</data>
<data name="CannotDelete_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not deletable, entity has no primary key: {entityString}</value>
</data>
<data name="CannotDelete_PrimaryKey_NotSet" xml:space="preserve">
<value>FreeSql: Not deletable, no value for primary key set: {entityString}</value>
</data>
<data name="CannotEdit_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not editable, entity has no primary key: {entityString}</value>
</data>
<data name="CannotUpdate_DataShouldQueryOrAttach" xml:space="preserve">
<value>FreeSql: Not updatable, data not tracked, should be queried first or Attach:{entityString}</value>
</data>
<data name="CannotUpdate_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not updatable, entity has no primary key: {entityString}</value>
</data>
<data name="CannotUpdate_PrimaryKey_NotSet" xml:space="preserve">
<value>FreeSql: Not updatable, no value for primary key set: {entityString}</value>
</data>
<data name="CannotUpdate_RecordDoesNotExist" xml:space="preserve">
<value>FreeSql: Not updatable, the record does not exist in the database: {entityString}</value>
</data>
<data name="ConfigureUseFreeSql" xml:space="preserve">
<value>FreeSql: Please configure UseFreeSql in OnConfiguring or AddFreeDbContext</value>
</data>
<data name="DbSetAsType_NotSupport_Object" xml:space="preserve">
<value>FreeSql: DbSet. AsType parameter error, please pass in the correct entity type</value>
</data>
<data name="EntityType_CannotConvert" xml:space="preserve">
<value>FreeSql: Entity type {EntityTypeName} cannot be converted to {name} and cannot use this method</value>
</data>
<data name="EntityType_PrimaryKeyError" xml:space="preserve">
<value>FreeSql: Entity type {EntityTypeName} Primary key type is not {fullName} and cannot be used with this method</value>
</data>
<data name="EntityType_PrimaryKeyIsNotOne" xml:space="preserve">
<value>FreeSql: Entity type {EntityTypeName} Primary key number is not 1 and cannot be used with this method</value>
</data>
<data name="FailedSetFilter_NotBelongIRpository" xml:space="preserve">
<value>FreeSql: FreeSql. Repository failed to set filter because object does not belong to IRepository</value>
</data>
<data name="Incomparable_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>FreeSql: Not comparable, entity has no primary key: {entityString}</value>
</data>
<data name="Incomparable_PrimaryKey_NotSet" xml:space="preserve">
<value>FreeSql: Non-comparable, no value for primary key set: {entityString}</value>
</data>
<data name="InsertError_Filter" xml:space="preserve">
<value>FreeSql: FreeSql.Repository Insert failed because the filter {filterKey}: {filterValueExpression} was set and the inserted data does not conform to {entityString}</value>
</data>
<data name="ISelectAsType_ParameterError" xml:space="preserve">
<value>FreeSql: ISelect. AsType parameter does not support specifying as object</value>
</data>
<data name="NotFound_Property" xml:space="preserve">
<value>FreeSql: Property {propertyName} does not exist for {tableTypeFullName}</value>
</data>
<data name="NotFoundMethod_StatesRemoveByObjects" xml:space="preserve">
<value>FreeSql: Method DbSet&lt;&gt; not found. StatesRemoveByObjects</value>
</data>
<data name="ParameterDataTypeError" xml:space="preserve">
<value>FreeSql: Parameter data type error {entityTypeFullName}</value>
</data>
<data name="ParameterError" xml:space="preserve">
<value>FreeSql: Parameter error {param}</value>
</data>
<data name="ParameterError_CannotBeNull" xml:space="preserve">
<value>FreeSql: Parameter error {param} cannot be null</value>
</data>
<data name="ParameterError_IsNot_CollectionProperties" xml:space="preserve">
<value>FreeSql: Parameter error {many} is not a collection property</value>
</data>
<data name="ParameterError_NotFound_CollectionProperties" xml:space="preserve">
<value>FreeSql: Parameter error {many} Collection property does not exist</value>
</data>
<data name="ParameterError_NotFound_Property" xml:space="preserve">
<value>FreeSql: Parameter error {one} attribute does not exist</value>
</data>
<data name="Propagation_Mandatory" xml:space="preserve">
<value>FreeSql: Propagation_ Mandatory: With the current transaction, throw an exception if there is no current transaction</value>
</data>
<data name="Propagation_Never" xml:space="preserve">
<value>FreeSql: Propagation_ Never: Perform the operation non-transactionally and throw an exception if the current transaction exists</value>
</data>
<data name="PropertyOfType_IsNot_OneToManyOrManyToMany" xml:space="preserve">
<value>FreeSql: Property {propertyName} of type {tableTypeFullName} is not OneToMany or ManyToMany attribute</value>
</data>
<data name="SpecialError_BatchAdditionFailed" xml:space="preserve">
<value>FreeSql: Special error: Bulk add failed, {dataType} returned data, does not match the number added</value>
</data>
<data name="SpecialError_UpdateFailedDataNotTracked" xml:space="preserve">
<value>FreeSql: Special error: Update failed, data not tracked: {entityString}</value>
</data>
<data name="TransactionHasBeenStarted" xml:space="preserve">
<value>FreeSql: Transaction opened, unit of work cannot be disabled</value>
</data>
<data name="TypeHasSetProperty_IgnoreAttribute" xml:space="preserve">
<value>FreeSql: The {tableTypeFullName} type has set the property {propertyName} Ignore the attribute</value>
</data>
<data name="UnitOfWorkManager_Construction_CannotBeNull" xml:space="preserve">
<value>FreeSql: The {unitOfWorkManager} constructor parameter {fsql} cannot be null</value>
</data>
<data name="UpdateError_Filter" xml:space="preserve">
<value>FreeSql: FreeSql.Repository Update failed because the filter {filterKey}: {filterValueExpression} is set and the updated data does not conform to {entityString}</value>
</data>
</root>

View File

@@ -1,246 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddFreeDbContextError_CheckConstruction" xml:space="preserve">
<value>AddFreeDbContext 发生错误,请检查 {dbContextTypeName} 的构造参数都已正确注入</value>
</data>
<data name="CannotAdd_AlreadyExistsInStateManagement" xml:space="preserve">
<value>不可添加,已存在于状态管理:{entityString}</value>
</data>
<data name="CannotAdd_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可添加,实体没有主键:{entityString}</value>
</data>
<data name="CannotAdd_PrimaryKey_NotSet" xml:space="preserve">
<value>不可添加,未设置主键的值:{entityString}</value>
</data>
<data name="CannotAdd_SelfIncreasingHasValue" xml:space="preserve">
<value>不可添加,自增属性有值:{entityString}</value>
</data>
<data name="CannotAttach_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可附加,实体没有主键:{entityString}</value>
</data>
<data name="CannotAttach_PrimaryKey_NotSet" xml:space="preserve">
<value>不可附加,未设置主键的值:{entityString}</value>
</data>
<data name="CannotDelete_DataNotTracked_ShouldQuery" xml:space="preserve">
<value>不可删除,数据未被跟踪,应该先查询:{entityString}</value>
</data>
<data name="CannotDelete_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可删除,实体没有主键:{entityString}</value>
</data>
<data name="CannotDelete_PrimaryKey_NotSet" xml:space="preserve">
<value>不可删除,未设置主键的值:{entityString}</value>
</data>
<data name="CannotEdit_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可进行编辑,实体没有主键:{entityString}</value>
</data>
<data name="CannotUpdate_DataShouldQueryOrAttach" xml:space="preserve">
<value>不可更新,数据未被跟踪,应该先查询 或者 Attach{entityString}</value>
</data>
<data name="CannotUpdate_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可更新,实体没有主键:{entityString}</value>
</data>
<data name="CannotUpdate_PrimaryKey_NotSet" xml:space="preserve">
<value>不可更新,未设置主键的值:{entityString}</value>
</data>
<data name="CannotUpdate_RecordDoesNotExist" xml:space="preserve">
<value>不可更新,数据库不存在该记录:{entityString}</value>
</data>
<data name="ConfigureUseFreeSql" xml:space="preserve">
<value>请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql</value>
</data>
<data name="DbSetAsType_NotSupport_Object" xml:space="preserve">
<value>DbSet.AsType 参数错误,请传入正确的实体类型</value>
</data>
<data name="EntityType_CannotConvert" xml:space="preserve">
<value>实体类型 {EntityTypeName} 无法转换为 {name},无法使用该方法</value>
</data>
<data name="EntityType_PrimaryKeyError" xml:space="preserve">
<value>实体类型 {EntityTypeName} 主键类型不为 {fullName},无法使用该方法</value>
</data>
<data name="EntityType_PrimaryKeyIsNotOne" xml:space="preserve">
<value>实体类型 {EntityTypeName} 主键数量不为 1无法使用该方法</value>
</data>
<data name="FailedSetFilter_NotBelongIRpository" xml:space="preserve">
<value>FreeSql.Repository 设置过滤器失败,原因是对象不属于 IRepository</value>
</data>
<data name="Incomparable_EntityHasNo_PrimaryKey" xml:space="preserve">
<value>不可比较,实体没有主键:{entityString}</value>
</data>
<data name="Incomparable_PrimaryKey_NotSet" xml:space="preserve">
<value>不可比较,未设置主键的值:{entityString}</value>
</data>
<data name="InsertError_Filter" xml:space="preserve">
<value>FreeSql.Repository Insert 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},插入的数据不符合 {entityString}</value>
</data>
<data name="ISelectAsType_ParameterError" xml:space="preserve">
<value>ISelect.AsType 参数不支持指定为 object</value>
</data>
<data name="NotFound_Property" xml:space="preserve">
<value>{tableTypeFullName} 不存在属性 {propertyName}</value>
</data>
<data name="NotFoundMethod_StatesRemoveByObjects" xml:space="preserve">
<value>找不到方法 DbSet&lt;&gt;.StatesRemoveByObjects</value>
</data>
<data name="ParameterDataTypeError" xml:space="preserve">
<value>参数 data 类型错误 {entityTypeFullName} </value>
</data>
<data name="ParameterError" xml:space="preserve">
<value>参数错误 {param}</value>
</data>
<data name="ParameterError_CannotBeNull" xml:space="preserve">
<value>参数错误 {param} 不能为 null</value>
</data>
<data name="ParameterError_IsNot_CollectionProperties" xml:space="preserve">
<value>参数错误 {many} 不是集合属性</value>
</data>
<data name="ParameterError_NotFound_CollectionProperties" xml:space="preserve">
<value>参数错误 {many} 集合属性不存在</value>
</data>
<data name="ParameterError_NotFound_Property" xml:space="preserve">
<value>参数错误 {one} 属性不存在</value>
</data>
<data name="Propagation_Mandatory" xml:space="preserve">
<value>Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常</value>
</data>
<data name="Propagation_Never" xml:space="preserve">
<value>Propagation_Never: 以非事务方式执行操作,如果当前事务存在则抛出异常</value>
</data>
<data name="PropertyOfType_IsNot_OneToManyOrManyToMany" xml:space="preserve">
<value>{tableTypeFullName} 类型的属性 {propertyName} 不是 OneToMany 或 ManyToMany 特性</value>
</data>
<data name="SpecialError_BatchAdditionFailed" xml:space="preserve">
<value>特别错误:批量添加失败,{dataType} 的返回数据,与添加的数目不匹配</value>
</data>
<data name="SpecialError_UpdateFailedDataNotTracked" xml:space="preserve">
<value>特别错误:更新失败,数据未被跟踪:{entityString}</value>
</data>
<data name="TransactionHasBeenStarted" xml:space="preserve">
<value>已开启事务,不能禁用工作单元</value>
</data>
<data name="TypeHasSetProperty_IgnoreAttribute" xml:space="preserve">
<value>{tableTypeFullName} 类型已设置属性 {propertyName} 忽略特性</value>
</data>
<data name="UnitOfWorkManager_Construction_CannotBeNull" xml:space="preserve">
<value>{unitOfWorkManager} 构造参数 {fsql} 不能为 null</value>
</data>
<data name="UpdateError_Filter" xml:space="preserve">
<value>FreeSql.Repository Update 失败,因为设置了过滤器 {filterKey}: {filterValueExpression},更新的数据不符合{entityString}</value>
</data>
</root>

View File

@@ -197,12 +197,12 @@ namespace FreeSql
TEntity CheckTKeyAndReturnIdEntity(TKey id)
{
var tb = _db.OrmOriginal.CodeFirst.GetTableByEntity(EntityType);
if (tb.Primarys.Length != 1) throw new Exception(DbContextStrings.EntityType_PrimaryKeyIsNotOne(EntityType.Name));
if (tb.Primarys[0].CsType.NullableTypeOrThis() != typeof(TKey).NullableTypeOrThis()) throw new Exception(DbContextStrings.EntityType_PrimaryKeyError(EntityType.Name, typeof(TKey).FullName));
if (tb.Primarys.Length != 1) throw new Exception(DbContextErrorStrings.EntityType_PrimaryKeyIsNotOne(EntityType.Name));
if (tb.Primarys[0].CsType.NullableTypeOrThis() != typeof(TKey).NullableTypeOrThis()) throw new Exception(DbContextErrorStrings.EntityType_PrimaryKeyError(EntityType.Name, typeof(TKey).FullName));
var obj = tb.Type.CreateInstanceGetDefaultValue();
_db.OrmOriginal.SetEntityValueWithPropertyName(tb.Type, obj, tb.Primarys[0].CsName, id);
var ret = obj as TEntity;
if (ret == null) throw new Exception(DbContextStrings.EntityType_CannotConvert(EntityType.Name, typeof(TEntity).Name));
if (ret == null) throw new Exception(DbContextErrorStrings.EntityType_CannotConvert(EntityType.Name, typeof(TEntity).Name));
return ret;
}

View File

@@ -55,7 +55,7 @@ namespace FreeSql
public void Close()
{
if (_tran != null)
throw new Exception(DbContextStrings.TransactionHasBeenStarted);
throw new Exception(DbContextErrorStrings.TransactionHasBeenStarted);
Enable = false;
}

View File

@@ -22,7 +22,7 @@ namespace FreeSql
public UnitOfWorkManager(IFreeSql fsql)
{
if (fsql == null) throw new ArgumentNullException(DbContextStrings.UnitOfWorkManager_Construction_CannotBeNull(nameof(UnitOfWorkManager), nameof(fsql)));
if (fsql == null) throw new ArgumentNullException(DbContextErrorStrings.UnitOfWorkManager_Construction_CannotBeNull(nameof(UnitOfWorkManager), nameof(fsql)));
_ormScoped = DbContextScopedFreeSql.Create(fsql, null, () => this.Current);
}
@@ -93,7 +93,7 @@ namespace FreeSql
{
case Propagation.Required: return FindedUowCreateVirtual() ?? CreateUow(isolationLevel);
case Propagation.Supports: return FindedUowCreateVirtual() ?? CreateUowNothing(_allUows.LastOrDefault()?.IsNotSupported ?? false);
case Propagation.Mandatory: return FindedUowCreateVirtual() ?? throw new Exception(DbContextStrings.Propagation_Mandatory);
case Propagation.Mandatory: return FindedUowCreateVirtual() ?? throw new Exception(DbContextErrorStrings.Propagation_Mandatory);
case Propagation.NotSupported: return CreateUowNothing(true);
case Propagation.Never:
var isNotSupported = _allUows.LastOrDefault()?.IsNotSupported ?? false;
@@ -101,7 +101,7 @@ namespace FreeSql
{
for (var a = _rawUows.Count - 1; a >= 0; a--)
if (_rawUows[a].Uow.GetOrBeginTransaction(false) != null)
throw new Exception(DbContextStrings.Propagation_Never);
throw new Exception(DbContextErrorStrings.Propagation_Never);
}
return CreateUowNothing(isNotSupported);
case Propagation.Nested: return CreateUow(isolationLevel);

View File

@@ -47,14 +47,14 @@ namespace FreeSql.DataAnnotations
{
var atm = Regex.Match(AsTable, @"([\w_\d]+)\s*=\s*(\d\d\d\d)\s*\-\s*(\d\d?)\s*\-\s*(\d\d?)\s*( [\d:]+)?\(([\d,]+)\s*(year|month|day|hour)\)", RegexOptions.IgnoreCase);
if (atm.Success == false)
throw new Exception(CoreStrings.AsTable_PropertyName_FormatError(AsTable));
throw new Exception(CoreErrorStrings.AsTable_PropertyName_FormatError(AsTable));
tb.AsTableColumn = tb.Columns.TryGetValue(atm.Groups[1].Value, out var trycol) ? trycol :
tb.ColumnsByCs.TryGetValue(atm.Groups[1].Value, out trycol) ? trycol : throw new Exception(CoreStrings.NotFound_Table_Property_AsTable(atm.Groups[1].Value));
tb.ColumnsByCs.TryGetValue(atm.Groups[1].Value, out trycol) ? trycol : throw new Exception(CoreErrorStrings.NotFound_Table_Property_AsTable(atm.Groups[1].Value));
if (tb.AsTableColumn.Attribute.MapType.NullableTypeOrThis() != typeof(DateTime))
{
tb.AsTableColumn = null;
throw new Exception(CoreStrings.AsTable_PropertyName_NotDateTime(atm.Groups[1].Value));
throw new Exception(CoreErrorStrings.AsTable_PropertyName_NotDateTime(atm.Groups[1].Value));
}
var beginTime = $"{atm.Groups[2].Value}-{atm.Groups[3].Value}-{atm.Groups[4].Value}";
var atm5 = atm.Groups[5].Value;
@@ -77,7 +77,7 @@ namespace FreeSql.DataAnnotations
case "day": return dt.AddDays(atm6);
case "hour": return dt.AddHours(atm6);
}
throw new NotImplementedException(CoreStrings.Functions_AsTable_NotImplemented(AsTable));
throw new NotImplementedException(CoreErrorStrings.Functions_AsTable_NotImplemented(AsTable));
});
}
}
@@ -118,13 +118,13 @@ namespace FreeSql.DataAnnotations
public DateTimeAsTableImpl(string tableName, DateTime beginTime, Func<DateTime, int, DateTime> nextTimeFunc)
{
if (nextTimeFunc == null) throw new ArgumentException(CoreStrings.Cannot_Be_NULL_Name("nextTimeFunc"));
if (nextTimeFunc == null) throw new ArgumentException(CoreErrorStrings.Cannot_Be_NULL_Name("nextTimeFunc"));
//beginTime = beginTime.Date; //日期部分作为开始
_beginTime = beginTime;
_nextTimeFunc = nextTimeFunc;
_tableName = tableName;
_tableNameFormat = _regTableNameFormat.Match(tableName);
if (string.IsNullOrEmpty(_tableNameFormat.Groups[1].Value)) throw new ArgumentException(CoreStrings.TableName_Format_Error("yyyyMMdd"));
if (string.IsNullOrEmpty(_tableNameFormat.Groups[1].Value)) throw new ArgumentException(CoreErrorStrings.TableName_Format_Error("yyyyMMdd"));
ExpandTable(beginTime, DateTime.Now);
}
@@ -139,7 +139,7 @@ namespace FreeSql.DataAnnotations
{
var dtstr = beginTime.ToString(_tableNameFormat.Groups[1].Value);
var name = _tableName.Replace(_tableNameFormat.Groups[0].Value, dtstr);
if (_allTables.Contains(name)) throw new ArgumentException(CoreStrings.Generated_Same_SubTable(_tableName));
if (_allTables.Contains(name)) throw new ArgumentException(CoreErrorStrings.Generated_Same_SubTable(_tableName));
_allTables.Insert(0, name);
_allTablesTime.Insert(0, beginTime);
_lastTime = _nextTimeFunc(beginTime, index++);
@@ -160,26 +160,26 @@ namespace FreeSql.DataAnnotations
}
DateTime ParseColumnValue(object columnValue)
{
if (columnValue == null) throw new Exception(CoreStrings.SubTableFieldValue_IsNotNull);
if (columnValue == null) throw new Exception(CoreErrorStrings.SubTableFieldValue_IsNotNull);
DateTime dt;
if (columnValue is DateTime || columnValue is DateTime?)
dt = (DateTime)columnValue;
else if (columnValue is string)
{
if (DateTime.TryParse(string.Concat(columnValue), out dt) == false) throw new Exception(CoreStrings.SubTableFieldValue_NotConvertDateTime(columnValue));
if (DateTime.TryParse(string.Concat(columnValue), out dt) == false) throw new Exception(CoreErrorStrings.SubTableFieldValue_NotConvertDateTime(columnValue));
}
else if (columnValue is int || columnValue is long)
{
dt = new DateTime(1970, 1, 1).AddSeconds((double)columnValue);
}
else throw new Exception(CoreStrings.SubTableFieldValue_NotConvertDateTime(columnValue));
else throw new Exception(CoreErrorStrings.SubTableFieldValue_NotConvertDateTime(columnValue));
return dt;
}
public string GetTableNameByColumnValue(object columnValue, bool autoExpand = false)
{
var dt = ParseColumnValue(columnValue);
if (dt < _beginTime) throw new Exception(CoreStrings.SubTableFieldValue_CannotLessThen(dt.ToString("yyyy-MM-dd HH:mm:ss"), _beginTime.ToString("yyyy-MM-dd HH:mm:ss")));
if (dt < _beginTime) throw new Exception(CoreErrorStrings.SubTableFieldValue_CannotLessThen(dt.ToString("yyyy-MM-dd HH:mm:ss"), _beginTime.ToString("yyyy-MM-dd HH:mm:ss")));
if (dt >= _lastTime && autoExpand)
{
// 扩容分表
@@ -192,7 +192,7 @@ namespace FreeSql.DataAnnotations
if (dt >= _allTablesTime[a])
return _allTables[a];
}
throw new Exception(CoreStrings.SubTableFieldValue_NotMatchTable(dt.ToString("yyyy-MM-dd HH:mm:ss")));
throw new Exception(CoreErrorStrings.SubTableFieldValue_NotMatchTable(dt.ToString("yyyy-MM-dd HH:mm:ss")));
}
public string[] GetTableNamesByColumnValueRange(object columnValue1, object columnValue2)
{
@@ -312,7 +312,7 @@ namespace FreeSql.DataAnnotations
{
var val1 = LocalGetParamValue(m.Groups[1].Value);
var val2 = LocalGetParamValue(m.Groups[2].Value);
if (val1 == null || val2 == null) throw new Exception(CoreStrings.Failed_SubTable_FieldValue(sqlWhere));
if (val1 == null || val2 == null) throw new Exception(CoreErrorStrings.Failed_SubTable_FieldValue(sqlWhere));
return new IAsTableTableNameRangeResult(GetTableNamesByColumnValueRange(val1, val2), ParseColumnValue(val1), ParseColumnValue(val2));
}
m = regs[8].Match(newSqlWhere);
@@ -320,14 +320,14 @@ namespace FreeSql.DataAnnotations
{
var val1 = LocalGetParamValue(m.Groups[2].Value);
var val2 = LocalGetParamValue(m.Groups[4].Value);
if (val1 == null || val2 == null) throw new Exception(CoreStrings.Failed_SubTable_FieldValue(sqlWhere));
if (val1 == null || val2 == null) throw new Exception(CoreErrorStrings.Failed_SubTable_FieldValue(sqlWhere));
return LocalGetTables(m.Groups[1].Value, m.Groups[3].Value, ParseColumnValue(val1), ParseColumnValue(val2));
}
m = regs[10].Match(newSqlWhere);
if (m.Success)
{
var val1 = LocalGetParamValue(m.Groups[2].Value);
if (val1 == null) throw new Exception(CoreStrings.Failed_SubTable_FieldValue(sqlWhere));
if (val1 == null) throw new Exception(CoreErrorStrings.Failed_SubTable_FieldValue(sqlWhere));
return LocalGetTables2(m.Groups[1].Value, ParseColumnValue(val1));
}
return new IAsTableTableNameRangeResult(_GetDefaultAllTables?.Invoke(AllTables) ?? AllTables, _beginTime, _lastTime);

View File

@@ -60,7 +60,7 @@ namespace FreeSql.DataAnnotations
public ColumnFluent Property(string proto)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_PropertyName(proto));
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreErrorStrings.NotFound_PropertyName(proto));
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { });
return new ColumnFluent(col, tryProto, _entityType);
}
@@ -76,7 +76,7 @@ namespace FreeSql.DataAnnotations
public TableFluent Navigate(string proto, string bind, string tempPrimary) => NavigateInternal(proto, bind, tempPrimary, null);
TableFluent NavigateInternal(string proto, string bind, string tempPrimary, Type manyToMany)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_Property(proto));
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreErrorStrings.NotFound_Property(proto));
var nav = new NavigateAttribute { Bind = bind, TempPrimary = tempPrimary, ManyToMany = manyToMany };
_table._navigates.AddOrUpdate(tryProto.Name, nav, (name, old) => nav);
return this;
@@ -156,12 +156,12 @@ namespace FreeSql.DataAnnotations
var exp = column?.Body;
if (exp?.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
var proto = (exp as MemberExpression)?.Member;
if (proto == null) throw new FormatException(CoreStrings.Bad_Expression_Format(column));
if (proto == null) throw new FormatException(CoreErrorStrings.Bad_Expression_Format(column));
return Property(proto.Name);
}
public ColumnFluent Property(string proto)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_PropertyName(proto));
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreErrorStrings.NotFound_PropertyName(proto));
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { });
return new ColumnFluent(col, tryProto, typeof(T));
}
@@ -181,14 +181,14 @@ namespace FreeSql.DataAnnotations
var exp = proto?.Body;
if (exp.NodeType == ExpressionType.Convert) exp = (exp as UnaryExpression)?.Operand;
var member = (exp as MemberExpression)?.Member;
if (member == null) throw new FormatException(CoreStrings.Bad_Expression_Format(proto));
if (member == null) throw new FormatException(CoreErrorStrings.Bad_Expression_Format(proto));
return NavigateInternal(member.Name, bind, tempPrimary, manyToMany);
}
public TableFluent<T> Navigate(string proto, string bind, Type manyToMany = null) => NavigateInternal(proto, bind, null, manyToMany);
public TableFluent<T> Navigate(string proto, string bind, string tempPrimary) => NavigateInternal(proto, bind, tempPrimary, null);
TableFluent<T> NavigateInternal(string proto, string bind, string tempPrimary, Type manyToMany)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_PropertyName(proto));
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreErrorStrings.NotFound_PropertyName(proto));
var nav = new NavigateAttribute { Bind = bind, TempPrimary = tempPrimary, ManyToMany = manyToMany };
_table._navigates.AddOrUpdate(tryProto.Name, nav, (name, old) => nav);
return this;

View File

@@ -13,8 +13,8 @@ namespace FreeSql
static object _dicCurdLock = new object();
static IFreeSql GetCrud(IDbConnection dbconn)
{
if (dbconn == null) throw new ArgumentNullException($"{nameof(dbconn)} {CoreStrings.Cannot_Be_NULL}");
if (dbconn.ConnectionString == null) throw new ArgumentNullException($"{nameof(dbconn)}.ConnectionString {CoreStrings.Cannot_Be_NULL}");
if (dbconn == null) throw new ArgumentNullException($"{nameof(dbconn)} {CoreErrorStrings.Cannot_Be_NULL}");
if (dbconn.ConnectionString == null) throw new ArgumentNullException($"{nameof(dbconn)}.ConnectionString {CoreErrorStrings.Cannot_Be_NULL}");
Type dbconType = dbconn.GetType();
var connType = dbconType.UnderlyingSystemType;
if (_dicCurd.TryGetValue(dbconn.ConnectionString, out var fsql)) return fsql;
@@ -25,49 +25,49 @@ namespace FreeSql
case "MySqlConnection":
providerType = Type.GetType("FreeSql.MySql.MySqlProvider`1,FreeSql.Provider.MySql")?.MakeGenericType(connType);
if (providerType == null) providerType = Type.GetType("FreeSql.MySql.MySqlProvider`1,FreeSql.Provider.MySqlConnector")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("MySql"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("MySql"));
break;
case "SqlConnection":
providerType = Type.GetType("FreeSql.SqlServer.SqlServerProvider`1,FreeSql.Provider.SqlServer")?.MakeGenericType(connType);
if (providerType == null) providerType = Type.GetType("FreeSql.SqlServer.SqlServerProvider`1,FreeSql.Provider.SqlServerForSystem")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("SqlServer/SqlServerForSystem"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("SqlServer/SqlServerForSystem"));
break;
case "NpgsqlConnection":
providerType = Type.GetType("FreeSql.PostgreSQL.PostgreSQLProvider`1,FreeSql.Provider.PostgreSQL")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("PostgreSQL"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("PostgreSQL"));
break;
case "OracleConnection":
providerType = Type.GetType("FreeSql.Oracle.OracleProvider`1,FreeSql.Provider.Oracle")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("Oracle"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("Oracle"));
break;
case "SQLiteConnection":
case "SqliteConnection":
providerType = Type.GetType("FreeSql.Sqlite.SqliteProvider`1,FreeSql.Provider.Sqlite")?.MakeGenericType(connType);
if (providerType == null) providerType = Type.GetType("FreeSql.Sqlite.SqliteProvider`1,FreeSql.Provider.SqliteCore")?.MakeGenericType(connType); //Microsoft.Data.Sqlite.Core.dll
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("Sqlite/SqliteCore"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("Sqlite/SqliteCore"));
break;
case "DmConnection":
providerType = Type.GetType("FreeSql.Dameng.DamengProvider`1,FreeSql.Provider.Dameng")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("Dameng"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("Dameng"));
break;
case "OscarConnection":
providerType = Type.GetType("FreeSql.ShenTong.ShenTongProvider`1,FreeSql.Provider.ShenTong")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("ShenTong"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("ShenTong"));
break;
case "KdbndpConnection":
providerType = Type.GetType("FreeSql.KingbaseES.KingbaseESProvider`1,FreeSql.Provider.KingbaseES")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("KingbaseES"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("KingbaseES"));
break;
case "FbConnection":
providerType = Type.GetType("FreeSql.Firebird.FirebirdProvider`1,FreeSql.Provider.Firebird")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("Firebird"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("Firebird"));
break;
case "ClickHouseConnection":
providerType = Type.GetType("FreeSql.ClickHouse.ClickHouseProvider`1,FreeSql.Provider.ClickHouse")?.MakeGenericType(connType);
if (providerType == null) throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package("ClickHouse"));
if (providerType == null) throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package("ClickHouse"));
break;
default:
throw new Exception(CoreStrings.Not_Implemented);
throw new Exception(CoreErrorStrings.Not_Implemented);
}
lock (_dicCurdLock)
{
@@ -79,7 +79,7 @@ namespace FreeSql
}
static IFreeSql GetCrud(IDbTransaction dbtran)
{
if (dbtran == null) throw new ArgumentNullException($"{nameof(dbtran)} {CoreStrings.Cannot_Be_NULL}");
if (dbtran == null) throw new ArgumentNullException($"{nameof(dbtran)} {CoreErrorStrings.Cannot_Be_NULL}");
return GetCrud(dbtran.Connection);
}

View File

@@ -573,7 +573,7 @@ namespace FreeSql
if (expContext.ParsedContent["delimiter"] == "','")
expContext.Result = $"wm_concat_text({expContext.ParsedContent["column"]})";
else
throw new NotImplementedException(CoreStrings.GBase_NotSupport_OtherThanCommas);
throw new NotImplementedException(CoreErrorStrings.GBase_NotSupport_OtherThanCommas);
//expContext.Result = $"replace(wm_concat_text({expContext.ParsedContent["column"]}), ',', {expContext.ParsedContent["delimiter"]})";
return null;
}

View File

@@ -193,7 +193,7 @@ public static partial class FreeSqlGlobalExtensions
.OrderBy(a => a.IsPublic ? 0 : 1)
.FirstOrDefault();
}));
if (ret.Value == null && isThrow) throw new ArgumentException(CoreStrings.Type_Cannot_Access_Constructor(that.FullName));
if (ret.Value == null && isThrow) throw new ArgumentException(CoreErrorStrings.Type_Cannot_Access_Constructor(that.FullName));
return ret.Value;
}
@@ -416,7 +416,7 @@ public static partial class FreeSqlGlobalExtensions
var t1sel = orm.Select<object>().AsType(entityType) as Select1Provider<object>;
var t1expFul = t1sel.ConvertStringPropertyToExpression(property, true);
var t1exp = props.Length == 1 ? t1expFul : t1sel.ConvertStringPropertyToExpression(props[0], true);
if (t1expFul == null) throw new ArgumentException(CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property)));
if (t1expFul == null) throw new ArgumentException(CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property)));
var propElementType = t1expFul.Type.GetGenericArguments().FirstOrDefault() ?? t1expFul.Type.GetElementType();
if (propElementType != null) //IncludeMany
{
@@ -432,7 +432,7 @@ public static partial class FreeSqlGlobalExtensions
return list;
}
var tbtr = t1tb.GetTableRef(props[0], true, true);
if (tbtr == null) throw new ArgumentException(CoreStrings.ParameterError_NotValid_Navigation(nameof(property)));
if (tbtr == null) throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_Navigation(nameof(property)));
var reftb = orm.CodeFirst.GetTableByEntity(t1exp.Type);
var refsel = orm.Select<object>().AsType(t1exp.Type) as Select1Provider<object>;
if (props.Length > 1)
@@ -479,14 +479,14 @@ public static partial class FreeSqlGlobalExtensions
}
var sel = orm.Select<object>().AsType(entityType) as Select1Provider<object>;
var exp = sel.ConvertStringPropertyToExpression(property, true);
if (exp == null) throw new ArgumentException(CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property)));
if (exp == null) throw new ArgumentException(CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property)));
var memExp = exp as MemberExpression;
if (memExp == null) throw new ArgumentException($"{CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property))}2");
if (memExp == null) throw new ArgumentException($"{CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property))}2");
var parTb = orm.CodeFirst.GetTableByEntity(memExp.Expression.Type);
if (parTb == null) throw new ArgumentException($"{CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property))}3");
if (parTb == null) throw new ArgumentException($"{CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property))}3");
var propElementType = exp.Type.GetGenericArguments().FirstOrDefault() ?? exp.Type.GetElementType();
var reftb = orm.CodeFirst.GetTableByEntity(propElementType);
if (reftb == null) throw new ArgumentException(CoreStrings.ParameterError_NotValid_Collection(nameof(property)));
if (reftb == null) throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_Collection(nameof(property)));
if (string.IsNullOrWhiteSpace(where) == false)
{
@@ -499,12 +499,12 @@ public static partial class FreeSqlGlobalExtensions
for (var a = 0; a < whereSplit.Length; a++)
{
var keyval = whereSplit[a].Split('=').Select(x => x.Trim()).Where(x => string.IsNullOrWhiteSpace(x) == false).ToArray();
if (keyval.Length != 2) throw new ArgumentException(CoreStrings.ParameterError_NotValid_UseCommas(nameof(where)));
if (keyval.Length != 2) throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_UseCommas(nameof(where)));
if (reftb.ColumnsByCs.TryGetValue(keyval[0], out var keycol) == false)
throw new ArgumentException(CoreStrings.ParameterError_NotValid_PropertyName(nameof(where), keyval[0], reftb.Type.DisplayCsharp()));
throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_PropertyName(nameof(where), keyval[0], reftb.Type.DisplayCsharp()));
if (parTb.ColumnsByCs.TryGetValue(keyval[1], out var valcol) == false)
throw new ArgumentException(CoreStrings.ParameterError_NotValid_PropertyName(nameof(where), keyval[1], parTb.Type.DisplayCsharp()));
throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_PropertyName(nameof(where), keyval[1], parTb.Type.DisplayCsharp()));
var tmpExp = Expression.Equal(
Expression.Convert(Expression.MakeMemberAccess(refparamExp, reftb.Properties[keyval[0]]), valcol.CsType),
@@ -530,7 +530,7 @@ public static partial class FreeSqlGlobalExtensions
select.Split(',').Select(x => x.Trim()).Where(x => string.IsNullOrWhiteSpace(x) == false).Select(a =>
{
if (reftb.ColumnsByCs.TryGetValue(a, out var col) == false)
throw new ArgumentException(CoreStrings.ParameterError_NotValid_PropertyName(nameof(select), a, reftb.Type.DisplayCsharp()));
throw new ArgumentException(CoreErrorStrings.ParameterError_NotValid_PropertyName(nameof(select), a, reftb.Type.DisplayCsharp()));
return Expression.Bind(reftb.Properties[col.CsName], Expression.MakeMemberAccess(refparamExp, reftb.Properties[col.CsName]));
}).ToArray());
@@ -555,7 +555,7 @@ public static partial class FreeSqlGlobalExtensions
}
var navigateSelector = Expression.Lambda(funcType, exp, sel._tables[0].Parameter);
var incMethod = sel.GetType().GetMethod("IncludeMany");
if (incMethod == null) throw new Exception(CoreStrings.RunTimeError_Reflection_IncludeMany);
if (incMethod == null) throw new Exception(CoreErrorStrings.RunTimeError_Reflection_IncludeMany);
incMethod.MakeGenericMethod(reftb.Type).Invoke(sel, new object[] { navigateSelector, newthen });
return sel;
}
@@ -639,7 +639,7 @@ public static partial class FreeSqlGlobalExtensions
var navs = tb.GetAllTableRef().Where(a => a.Value.Exception == null).Select(a => a.Value)
.Where(a => a.RefType == FreeSql.Internal.Model.TableRefType.OneToMany && a.RefEntityType == tb.Type).ToArray();
if (navs.Length != 1) throw new ArgumentException(CoreStrings.Entity_NotParentChild_Relationship(tb.Type.FullName));
if (navs.Length != 1) throw new ArgumentException(CoreErrorStrings.Entity_NotParentChild_Relationship(tb.Type.FullName));
var tbref = navs[0];
var cteName = "as_tree_cte";
@@ -693,7 +693,7 @@ public static partial class FreeSqlGlobalExtensions
}
if (int.TryParse((mysqlVersion ?? "").Split('.')[0], out var mysqlVersionFirst) && mysqlVersionFirst < 8)
{
if (tbref.Columns.Count > 1) throw new ArgumentException(CoreStrings.Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeys(tb.Type.FullName));
if (tbref.Columns.Count > 1) throw new ArgumentException(CoreErrorStrings.Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeys(tb.Type.FullName));
var mysql56Sql = "";
if (up == false)
{
@@ -913,7 +913,7 @@ SELECT ");
case DataType.Firebird:
return that.OrderBy("rand()");
}
throw new NotSupportedException($"{CoreStrings.Not_Support_OrderByRandom(s0p._orm.Ado.DataType)}");
throw new NotSupportedException($"{CoreErrorStrings.Not_Support_OrderByRandom(s0p._orm.Ado.DataType)}");
}
#endregion
@@ -1083,9 +1083,9 @@ SELECT ");
public long ExecuteIdentity(string identityColumn)
{
if (string.IsNullOrEmpty(identityColumn))
throw new Exception(CoreStrings.Cannot_Be_NULL_Name(nameof(identityColumn)));
throw new Exception(CoreErrorStrings.Cannot_Be_NULL_Name(nameof(identityColumn)));
if (_insertProvider._table.ColumnsByCs.TryGetValue(identityColumn, out var col) == false)
throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(identityColumn).Replace(nameof(ExecuteIdentity), ""));
throw new Exception(CoreErrorStrings.GetPrimarys_ParameterError_IsNotDictKey(identityColumn).Replace(nameof(ExecuteIdentity), ""));
col.Attribute.IsIdentity = true;
return _insertProvider.ExecuteIdentity();
}
@@ -1098,9 +1098,9 @@ SELECT ");
public Task<long> ExecuteIdentityAsync(string identityColumn, CancellationToken cancellationToken = default)
{
if (string.IsNullOrEmpty(identityColumn))
throw new Exception(CoreStrings.Cannot_Be_NULL_Name(nameof(identityColumn)));
throw new Exception(CoreErrorStrings.Cannot_Be_NULL_Name(nameof(identityColumn)));
if (_insertProvider._table.ColumnsByCs.TryGetValue(identityColumn, out var col) == false)
throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(identityColumn).Replace(nameof(ExecuteIdentity), ""));
throw new Exception(CoreErrorStrings.GetPrimarys_ParameterError_IsNotDictKey(identityColumn).Replace(nameof(ExecuteIdentity), ""));
col.Attribute.IsIdentity = true;
return _insertProvider.ExecuteIdentityAsync(cancellationToken);
}
@@ -1163,7 +1163,7 @@ SELECT ");
foreach (var primary in primarys)
{
if (table.ColumnsByCs.TryGetValue(string.Concat(primary), out var col)) pks.Add(col);
else throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(primary));
else throw new Exception(CoreErrorStrings.GetPrimarys_ParameterError_IsNotDictKey(primary));
}
return pks.ToArray();
}
@@ -1182,17 +1182,17 @@ SELECT ");
col.Attribute.IsIdentity = true;
}
}
else throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(primary));
else throw new Exception(CoreErrorStrings.GetPrimarys_ParameterError_IsNotDictKey(primary));
}
table.Primarys = table.Columns.Where(a => a.Value.Attribute.IsPrimary).Select(a => a.Value).ToArray();
}
public UpdateDictImpl IsVersion(string version)
{
if (_updateProvider._table.ColumnsByCs.TryGetValue(version, out var col) == false)
throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(version).Replace(nameof(GetPrimarys), ""));
throw new Exception(CoreErrorStrings.GetPrimarys_ParameterError_IsNotDictKey(version).Replace(nameof(GetPrimarys), ""));
//if (col.Attribute.MapType.IsNullableType() ||
// col.Attribute.MapType.IsNumberType() == false && !new[] { typeof(byte[]), typeof(string) }.Contains(col.Attribute.MapType))
// throw new Exception(CoreStrings.Properties_AsRowLock_Must_Numeric_Byte(col.CsName));
// throw new Exception(CoreErrorStrings.Properties_AsRowLock_Must_Numeric_Byte(col.CsName));
col.Attribute.IsVersion = true;
_updateProvider._table.VersionColumn = col;
_updateProvider._versionColumn = col;

View File

@@ -25,12 +25,6 @@
<None Include="../readme.md" Pack="true" PackagePath="\" />
<None Include="../logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Properties\Resources.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="Properties\Resources.tt" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
@@ -42,11 +36,6 @@
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\CoreStrings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CoreStrings.Designer.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@@ -58,13 +47,6 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Select1Provider2`16.cs</LastGenOutput>
</None>
<None Update="Properties\CoreStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>CoreStrings.Designer.cs</LastGenOutput>
</None>
<EmbeddedResource Update="Properties\CoreStrings.resx">
<CustomToolNamespace>FreeSql</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ namespace FreeSql
/// <returns></returns>
public FreeSqlBuilder UseConnectionString(DataType dataType, string connectionString, Type providerType = null)
{
if (_connectionFactory != null) throw new Exception(CoreStrings.Has_Specified_Cannot_Specified_Second("UseConnectionFactory", "UseConnectionString"));
if (_connectionFactory != null) throw new Exception(CoreErrorStrings.Has_Specified_Cannot_Specified_Second("UseConnectionFactory", "UseConnectionString"));
_dataType = dataType;
_masterConnectionString = connectionString;
_providerType = providerType;
@@ -86,13 +86,13 @@ namespace FreeSql
/// <returns></returns>
public FreeSqlBuilder UseSlave(params string[] slaveConnectionString)
{
if (_connectionFactory != null) throw new Exception(CoreStrings.Has_Specified_Cannot_Specified_Second("UseConnectionFactory", "UseSlave"));
if (_connectionFactory != null) throw new Exception(CoreErrorStrings.Has_Specified_Cannot_Specified_Second("UseConnectionFactory", "UseSlave"));
_slaveConnectionString = slaveConnectionString;
return this;
}
public FreeSqlBuilder UseSlaveWeight(params int[] slaveWeights)
{
if (_slaveConnectionString?.Length != slaveWeights.Length) throw new Exception(CoreStrings.Different_Number_SlaveConnectionString_SlaveWeights);
if (_slaveConnectionString?.Length != slaveWeights.Length) throw new Exception(CoreErrorStrings.Different_Number_SlaveConnectionString_SlaveWeights);
_slaveWeights = slaveWeights;
return this;
}
@@ -105,8 +105,8 @@ namespace FreeSql
/// <returns></returns>
public FreeSqlBuilder UseConnectionFactory(DataType dataType, Func<DbConnection> connectionFactory, Type providerType = null)
{
if (string.IsNullOrEmpty(_masterConnectionString) == false) throw new Exception(CoreStrings.Has_Specified_Cannot_Specified_Second("UseConnectionString", "UseConnectionFactory"));
if (_slaveConnectionString?.Any() == true) throw new Exception(CoreStrings.Has_Specified_Cannot_Specified_Second("UseSlave", "UseConnectionFactory"));
if (string.IsNullOrEmpty(_masterConnectionString) == false) throw new Exception(CoreErrorStrings.Has_Specified_Cannot_Specified_Second("UseConnectionString", "UseConnectionFactory"));
if (_slaveConnectionString?.Any() == true) throw new Exception(CoreErrorStrings.Has_Specified_Cannot_Specified_Second("UseSlave", "UseConnectionFactory"));
_dataType = dataType;
_connectionFactory = connectionFactory;
_providerType = providerType;
@@ -244,7 +244,7 @@ namespace FreeSql
public IFreeSql Build() => Build<IFreeSql>();
public IFreeSql<TMark> Build<TMark>()
{
if (string.IsNullOrEmpty(_masterConnectionString) && _connectionFactory == null) throw new Exception(CoreStrings.Check_UseConnectionString);
if (string.IsNullOrEmpty(_masterConnectionString) && _connectionFactory == null) throw new Exception(CoreErrorStrings.Check_UseConnectionString);
IFreeSql<TMark> ret = null;
var type = _providerType;
if (type != null)
@@ -254,7 +254,7 @@ namespace FreeSql
}
else
{
Action<string, string> throwNotFind = (dll, providerType) => throw new Exception(CoreStrings.Missing_FreeSqlProvider_Package_Reason(dll, providerType));
Action<string, string> throwNotFind = (dll, providerType) => throw new Exception(CoreErrorStrings.Missing_FreeSqlProvider_Package_Reason(dll, providerType));
switch (_dataType)
{
case DataType.MySql:
@@ -385,7 +385,7 @@ namespace FreeSql
if (type == null) throwNotFind("FreeSql.Provider.Duckdb.dll", "FreeSql.Duckdb.DuckdbProvider<>");
break;
default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
default: throw new Exception(CoreErrorStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
}
}
ret = Activator.CreateInstance(type, new object[]

View File

@@ -436,7 +436,7 @@ namespace FreeSql.Internal
ReadAnonymousField(_tables, _tableRule, field, child, ref index, initAssignExp.Expression, select, diymemexp, whereGlobalFilter, findIncludeMany, findSubSelectMany, false);
}
}
if (parent.Childs.Any() == false) throw new Exception(CoreStrings.Mapping_Exception_HasNo_SamePropertyName(initExp.NewExpression.Type.Name));
if (parent.Childs.Any() == false) throw new Exception(CoreErrorStrings.Mapping_Exception_HasNo_SamePropertyName(initExp.NewExpression.Type.Name));
return true;
case ExpressionType.New:
var newExp = exp as NewExpression;
@@ -548,7 +548,7 @@ namespace FreeSql.Internal
}
}
}
if (parent.Childs.Any() == false) throw new Exception(CoreStrings.Mapping_Exception_HasNo_SamePropertyName(newExp.Type.Name));
if (parent.Childs.Any() == false) throw new Exception(CoreErrorStrings.Mapping_Exception_HasNo_SamePropertyName(newExp.Type.Name));
return true;
}
parent.DbField = ExpressionLambdaToSql(exp, getTSC()); //解决 new { a = id + 1 } 翻译后 ((id+1)) 问题
@@ -676,7 +676,7 @@ namespace FreeSql.Internal
var newArrMembers = new List<string>();
foreach (var newArrExp in newArr.Expressions) newArrMembers.AddRange(ExpressionSelectColumns_MemberAccess_New_NewArrayInit(_tables, _tableRule, newArrExp, isQuoteName, diymemexp));
return newArrMembers.Distinct().Select(a => a.Trim('\'')).ToArray();
default: throw new ArgumentException(CoreStrings.Unable_Parse_Expression(exp));
default: throw new ArgumentException(CoreErrorStrings.Unable_Parse_Expression(exp));
}
return new string[0];
}
@@ -1126,7 +1126,7 @@ namespace FreeSql.Internal
var eccFields = _dicTypeExpressionCallClassContextFields.GetOrAdd(exp3.Method.DeclaringType, dttp =>
dttp.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Static).Where(a => a.FieldType == typeof(ThreadLocal<ExpressionCallContext>)).ToArray());
if (eccFields.Any() == false)
throw new Exception(CoreStrings.Custom_Expression_ParsingError(exp3.Method.DeclaringType));
throw new Exception(CoreErrorStrings.Custom_Expression_ParsingError(exp3.Method.DeclaringType));
foreach (var eccField in eccFields)
typeof(ThreadLocal<ExpressionCallContext>).GetProperty("Value").SetValue(eccField.GetValue(null), ecc, null);
try
@@ -1150,7 +1150,7 @@ namespace FreeSql.Internal
case "System.String": other3Exp = ExpressionLambdaToSqlCallString(exp3, tsc); break;
case "System.Math": other3Exp = ExpressionLambdaToSqlCallMath(exp3, tsc); break;
case "System.DateTime": other3Exp = ExpressionLambdaToSqlCallDateTime(exp3, tsc); break;
case "System.TimeSpan": throw new Exception(CoreStrings.Unable_Parse_ExpressionMethod(callType.FullName));
case "System.TimeSpan": throw new Exception(CoreErrorStrings.Unable_Parse_ExpressionMethod(callType.FullName));
case "System.Convert": other3Exp = ExpressionLambdaToSqlCallConvert(exp3, tsc); break;
}
if (string.IsNullOrEmpty(other3Exp) == false) return other3Exp;
@@ -1315,7 +1315,7 @@ namespace FreeSql.Internal
fsql = Expression.Lambda(exp3tmpTestCall).Compile().DynamicInvoke();
var fsqlFindMethod = fsql.GetType().GetMethod(exp3tmpCall.Method.Name, exp3tmpCall.Arguments.Select(a => a.Type).ToArray());
if (fsqlFindMethod == null)
throw new Exception(CoreStrings.Unable_Parse_ExpressionMethod(exp3tmpCall.Method.Name));
throw new Exception(CoreErrorStrings.Unable_Parse_ExpressionMethod(exp3tmpCall.Method.Name));
var exp3StackOld = exp3Stack;
exp3Stack = new Stack<Expression>();
exp3Stack.Push(Expression.Call(Expression.Constant(fsql), fsqlFindMethod, exp3tmpCall.Arguments));
@@ -1353,7 +1353,7 @@ namespace FreeSql.Internal
//fsqltables[0].Alias = $"{tsc._tables[0].Alias}_{fsqltables[0].Alias}";
if (fsqltables != tsc._tables)
{
if (tsc._tables == null && tsc.diymemexp == null) throw new NotSupportedException(CoreStrings.EspeciallySubquery_Cannot_Parsing); //2020-12-11 IUpdate 条件不支持子查询
if (tsc._tables == null && tsc.diymemexp == null) throw new NotSupportedException(CoreErrorStrings.EspeciallySubquery_Cannot_Parsing); //2020-12-11 IUpdate 条件不支持子查询
if (tsc._tables != null) //groupby is null
{
fsqltables.AddRange(tsc._tables.Select(a => new SelectTableInfo
@@ -1655,7 +1655,7 @@ namespace FreeSql.Internal
var exp3Args0 = (exp3.Arguments[0] as UnaryExpression)?.Operand as LambdaExpression;
manySubSelectAggMethod = _dicSelectMethodToSql.GetOrAdd(fsqlType, fsqlType2 =>
fsqlType2.GetMethods().Where(a => a.Name == "ToSql" && a.GetParameters().Length == 2 && a.GetParameters()[1].ParameterType == typeof(FieldAliasOptions) && a.GetGenericArguments().Length == 1).FirstOrDefault());
if (manySubSelectAggMethod == null || exp3Args0 == null) throw new ArgumentException(CoreStrings.ManyToMany_AsSelect_NotSupport_Sum_Avg_etc);
if (manySubSelectAggMethod == null || exp3Args0 == null) throw new ArgumentException(CoreErrorStrings.ManyToMany_AsSelect_NotSupport_Sum_Avg_etc);
manySubSelectAggMethod = manySubSelectAggMethod.MakeGenericMethod(exp3Args0.ReturnType);
var fsqls0p = fsql as Select0Provider;
var fsqls0pWhere = fsqls0p._where.ToString();
@@ -1821,8 +1821,8 @@ namespace FreeSql.Internal
other3Exp = ExpressionLambdaToSqlOther(exp3, tsc);
if (string.IsNullOrEmpty(other3Exp) == false) return other3Exp;
if (exp3.CanDynamicInvoke()) return formatSql(Expression.Lambda(exp3).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams);
if (exp3.Method.DeclaringType == typeof(Enumerable)) throw new Exception(CoreStrings.Not_Implemented_Expression_UseAsSelect(exp3, exp3.Method.Name, (exp3.Arguments.Count > 1 ? "..." : "")));
throw new Exception(CoreStrings.Not_Implemented_Expression(exp3));
if (exp3.Method.DeclaringType == typeof(Enumerable)) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_UseAsSelect(exp3, exp3.Method.Name, (exp3.Arguments.Count > 1 ? "..." : "")));
throw new Exception(CoreErrorStrings.Not_Implemented_Expression(exp3));
case ExpressionType.Parameter:
case ExpressionType.MemberAccess:
var exp4 = exp as MemberExpression;
@@ -1859,7 +1859,7 @@ namespace FreeSql.Internal
case "TotalSeconds": return $"({left})";
}
}
throw new Exception(CoreStrings.Unable_Parse_Expression(exp4));
throw new Exception(CoreErrorStrings.Unable_Parse_Expression(exp4));
}
if (string.IsNullOrEmpty(extRet) == false) return extRet;
var other4Exp = ExpressionLambdaToSqlOther(exp4, tsc);
@@ -1935,7 +1935,7 @@ namespace FreeSql.Internal
}
while (expStack.Any())
{
if (firstValue == null) throw new Exception(CoreStrings.Cannot_Be_NULL_Name(exp));
if (firstValue == null) throw new Exception(CoreErrorStrings.Cannot_Be_NULL_Name(exp));
var expStackItem = expStack.Pop() as MemberExpression;
if (expStackItem.Member.MemberType == MemberTypes.Property)
firstValue = ((PropertyInfo)expStackItem.Member).GetValue(firstValue, null);
@@ -1982,8 +1982,8 @@ namespace FreeSql.Internal
if (tb.ColumnsByCs.ContainsKey(memberExp.Member.Name) == false)
{
if (tb.ColumnsByCsIgnore.ContainsKey(memberExp.Member.Name))
throw new ArgumentException(CoreStrings.Ignored_Check_Confirm_PublicGetSet(tb.DbName, memberExp.Member.Name));
throw new ArgumentException(CoreStrings.NotFound_Column(tb.DbName, memberExp.Member.Name));
throw new ArgumentException(CoreErrorStrings.Ignored_Check_Confirm_PublicGetSet(tb.DbName, memberExp.Member.Name));
throw new ArgumentException(CoreErrorStrings.NotFound_Column(tb.DbName, memberExp.Member.Name));
}
var curcol = tb.ColumnsByCs[memberExp.Member.Name];
if (tsc._selectColumnMap != null)
@@ -2111,7 +2111,7 @@ namespace FreeSql.Internal
switch (exp2.NodeType)
{
case ExpressionType.Constant:
throw new NotImplementedException($"{CoreStrings.Not_Implemented_MemberAcess_Constant}");
throw new NotImplementedException($"{CoreErrorStrings.Not_Implemented_MemberAcess_Constant}");
case ExpressionType.Parameter:
case ExpressionType.MemberAccess:
@@ -2130,7 +2130,7 @@ namespace FreeSql.Internal
}
name2 = col2.Attribute.Name;
tsc.SetMapColumnTmp(col2);
if (expStack.Count > 0) throw new Exception(CoreStrings.Unable_Parse_Expression(expStack.Pop()));
if (expStack.Count > 0) throw new Exception(CoreErrorStrings.Unable_Parse_Expression(expStack.Pop()));
break;
}
//判断 [JsonMap] 并非导航对象,所以在上面提前判断 ColumnsByCs
@@ -2183,10 +2183,10 @@ namespace FreeSql.Internal
}
}
if (tb2.ColumnsByCsIgnore.ContainsKey(mp2.Member.Name))
throw new ArgumentException(CoreStrings.Ignored_Check_Confirm_PublicGetSet(tb2.DbName, mp2.Member.Name));
throw new ArgumentException(CoreErrorStrings.Ignored_Check_Confirm_PublicGetSet(tb2.DbName, mp2.Member.Name));
if (tb2.GetTableRef(mp2.Member.Name, false, true) != null)
throw new ArgumentException(CoreStrings.Navigation_Missing_AsSelect(tb2.DbName, mp2.Member.Name));
throw new ArgumentException(CoreStrings.NotFound_Column(tb2.DbName, mp2.Member.Name));
throw new ArgumentException(CoreErrorStrings.Navigation_Missing_AsSelect(tb2.DbName, mp2.Member.Name));
throw new ArgumentException(CoreErrorStrings.NotFound_Column(tb2.DbName, mp2.Member.Name));
}
col2 = tb2.ColumnsByCs[mp2.Member.Name];
if (tsc._selectColumnMap != null && find2 != null)
@@ -3010,7 +3010,7 @@ namespace FreeSql.Internal
e.Result = $"({select.ToSql().Replace(" \r\n", " \r\n ")})";
return;
}
throw throwCallExp(CoreStrings.Not_Support);
throw throwCallExp(CoreErrorStrings.Not_Support);
case "ToList":
if (callExp.Arguments.Count == 1)
{
@@ -3019,7 +3019,7 @@ namespace FreeSql.Internal
e.Result = $"({select.ToSql().Replace(" \r\n", " \r\n ")})";
return;
}
throw throwCallExp(CoreStrings.Not_Support);
throw throwCallExp(CoreErrorStrings.Not_Support);
case "Contains":
if (callExp.Arguments.Count == 2)
{
@@ -3037,7 +3037,7 @@ namespace FreeSql.Internal
select.Distinct();
break;
}
throw throwCallExp(CoreStrings.Not_Support);
throw throwCallExp(CoreErrorStrings.Not_Support);
case "OrderBy":
select._tables[0].Parameter = (callExp.Arguments[1] as LambdaExpression)?.Parameters.FirstOrDefault();
LocalSetSelectProviderAlias(select._tables[0].Parameter.Name);
@@ -3068,7 +3068,7 @@ namespace FreeSql.Internal
select.InternalWhere(whereParam);
break;
}
throw throwCallExp(CoreStrings.Not_Support);
throw throwCallExp(CoreErrorStrings.Not_Support);
case "Skip":
select.Offset((int)callExp.Arguments[1].GetConstExprValue());
@@ -3086,9 +3086,9 @@ namespace FreeSql.Internal
select._selectExpression = selectParam;
break;
}
throw throwCallExp(CoreStrings.Not_Support);
throw throwCallExp(CoreErrorStrings.Not_Support);
}
Exception throwCallExp(string message) => new Exception(CoreStrings.Parsing_Failed(callExp.Method.Name, message));
Exception throwCallExp(string message) => new Exception(CoreErrorStrings.Parsing_Failed(callExp.Method.Name, message));
}
}
}

View File

@@ -654,7 +654,7 @@ namespace FreeSql.Internal.CommonProvider
ReturnConnection(pool, conn, ex); //pool.Return(conn, ex);
if (IsTracePerformance) logtxt.Append("Pool.Return: ").Append(DateTime.Now.Subtract(logtxt_dt).TotalMilliseconds).Append("ms Total: ").Append(DateTime.Now.Subtract(dt).TotalMilliseconds).Append("ms");
}
LoggerException(pool, pc, new Exception(CoreStrings.Connection_Failed_Switch_Servers), dt, logtxt, false);
LoggerException(pool, pc, new Exception(CoreErrorStrings.Connection_Failed_Switch_Servers), dt, logtxt, false);
pc.cmd.Parameters.Clear();
if (DataType == DataType.Sqlite) pc.cmd.Dispose();
ExecuteReaderMultiple(multipleResult, connection, transaction, fetchHandler, schemaHandler, cmdType, cmdText, cmdTimeout, cmdParms);

View File

@@ -574,7 +574,7 @@ namespace FreeSql.Internal.CommonProvider
ReturnConnection(pool, conn, ex); //pool.Return(conn, ex);
if (IsTracePerformance) logtxt.Append("Pool.Return: ").Append(DateTime.Now.Subtract(logtxt_dt).TotalMilliseconds).Append("ms Total: ").Append(DateTime.Now.Subtract(dt).TotalMilliseconds).Append("ms");
}
LoggerException(pool, pc, new Exception(CoreStrings.Connection_Failed_Switch_Servers), dt, logtxt, false);
LoggerException(pool, pc, new Exception(CoreErrorStrings.Connection_Failed_Switch_Servers), dt, logtxt, false);
pc.cmd.Parameters.Clear();
if (DataType == DataType.Sqlite) pc.cmd.Dispose();
await ExecuteReaderMultipleAsync(multipleResult, connection, transaction, fetchHandler, schemaHandler, cmdType, cmdText, cmdTimeout, cmdParms, cancellationToken);

View File

@@ -78,7 +78,7 @@ namespace FreeSql.Internal.CommonProvider
_trans.TryRemove(tran.Connection.LastGetThreadId, out var oldtran);
Exception ex = null;
if (string.IsNullOrEmpty(remark)) remark = isCommit ? CoreStrings.Commit : CoreStrings.RollBack;
if (string.IsNullOrEmpty(remark)) remark = isCommit ? CoreErrorStrings.Commit : CoreErrorStrings.RollBack;
try
{
if (tran.Transaction.Connection != null) //用户自行 Commit、Rollback

View File

@@ -18,23 +18,23 @@ namespace FreeSql.Internal.CommonProvider
public IInsert<T1> Insert<T1>() where T1 : class => CreateInsertProvider<T1>();
public IInsert<T1> Insert<T1>(T1 source) where T1 : class
{
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreStrings.Use_InsertDict_Method);
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreErrorStrings.Use_InsertDict_Method);
return this.Insert<T1>().AppendData(source);
}
public IInsert<T1> Insert<T1>(T1[] source) where T1 : class
{
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreStrings.Use_InsertDict_Method);
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreErrorStrings.Use_InsertDict_Method);
return this.Insert<T1>().AppendData(source);
}
public IInsert<T1> Insert<T1>(List<T1> source) where T1 : class
{
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreStrings.Use_InsertDict_Method);
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreErrorStrings.Use_InsertDict_Method);
return this.Insert<T1>().AppendData(source);
}
public IInsert<T1> Insert<T1>(IEnumerable<T1> source) where T1 : class
{
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreStrings.Use_InsertDict_Method);
if (typeof(T1) == typeof(Dictionary<string, object>)) throw new Exception(CoreErrorStrings.Use_InsertDict_Method);
return this.Insert<T1>().AppendData(source);
}
public IUpdate<T1> Update<T1>() where T1 : class => CreateUpdateProvider<T1>(null);

View File

@@ -176,10 +176,10 @@ namespace FreeSql.Internal.CommonProvider
}
public IDelete<T1> AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("IDelete"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("IDelete"));
if (entityType == _table.Type) return this;
var newtb = _commonUtils.GetTableByEntity(entityType);
_table = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("IDelete"));
_table = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("IDelete"));
if (_isAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
return this;
}

View File

@@ -51,7 +51,7 @@ namespace FreeSql.Internal.CommonProvider
_isAutoSyncStructure = _orm.CodeFirst.IsAutoSyncStructure;
_tempPrimarys = _table?.Primarys ?? new ColumnInfo[0];
if (_table == null && typeof(T1) != typeof(Dictionary<string, object>))
throw new Exception(CoreStrings.InsertOrUpdate_NotSuport_Generic_UseEntity(typeof(T1)));
throw new Exception(CoreErrorStrings.InsertOrUpdate_NotSuport_Generic_UseEntity(typeof(T1)));
if (_isAutoSyncStructure && typeof(T1) != typeof(object)) _orm.CodeFirst.SyncStructure<T1>();
IdentityColumn = _table?.Primarys.Where(a => a.Attribute.IsIdentity).FirstOrDefault();
}
@@ -157,7 +157,7 @@ namespace FreeSql.Internal.CommonProvider
{
if (data == null || table == null) return;
if (typeof(T1) == typeof(object) && new[] { table.Type, table.TypeLazy }.Contains(data.GetType()) == false)
throw new Exception(CoreStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
throw new Exception(CoreErrorStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
if (orm.Aop.AuditValueHandler == null) return;
foreach (var col in table.Columns.Values)
{
@@ -256,10 +256,10 @@ namespace FreeSql.Internal.CommonProvider
}
public IInsertOrUpdate<T1> AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("IInsertOrUpdate"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("IInsertOrUpdate"));
if (entityType == _table.Type) return this;
var newtb = _commonUtils.GetTableByEntity(entityType);
_table = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("IInsertOrUpdate"));
_table = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("IInsertOrUpdate"));
if (_isAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
_tempPrimarys = _table.Primarys;
if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
@@ -414,12 +414,12 @@ namespace FreeSql.Internal.CommonProvider
_SplitSourceByIdentityValueIsNullFlag = 2;
ExecuteBatchOptions(ss.Item2);
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -540,12 +540,12 @@ namespace FreeSql.Internal.CommonProvider
_SplitSourceByIdentityValueIsNullFlag = 2;
await ExecuteBatchOptions(ss.Item2);
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;

View File

@@ -164,7 +164,7 @@ namespace FreeSql.Internal.CommonProvider
{
if (data == null || table == null) return;
if (typeof(T1) == typeof(object) && new[] { table.Type, table.TypeLazy }.Contains(data.GetType()) == false)
throw new Exception(CoreStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
throw new Exception(CoreErrorStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
foreach (var col in table.Columns.Values)
{
object val = col.GetValue(data);
@@ -297,7 +297,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = _orm.Ado.MasterPool.Get())
{
_transaction = conn.Value.BeginTransaction();
@@ -312,12 +312,12 @@ namespace FreeSql.Internal.CommonProvider
ret += this.RawExecuteAffrows();
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -377,7 +377,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = _orm.Ado.MasterPool.Get())
{
_transaction = conn.Value.BeginTransaction();
@@ -393,12 +393,12 @@ namespace FreeSql.Internal.CommonProvider
else ret = this.RawExecuteIdentity();
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -457,7 +457,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = _orm.Ado.MasterPool.Get())
{
_transaction = conn.Value.BeginTransaction();
@@ -472,12 +472,12 @@ namespace FreeSql.Internal.CommonProvider
ret.AddRange(this.RawExecuteInserted());
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -597,11 +597,11 @@ namespace FreeSql.Internal.CommonProvider
}
public IInsert<T1> AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("IInsert"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("IInsert"));
if (entityType == typeof(T1)) return this;
if (entityType == _table.Type) return this;
var newtb = _commonUtils.GetTableByEntity(entityType);
_table = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("IInsert"));
_table = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("IInsert"));
if (_isAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
IgnoreCanInsert();
return this;

View File

@@ -55,7 +55,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = await _orm.Ado.MasterPool.GetAsync())
{
_transaction = conn.Value.BeginTransaction();
@@ -70,12 +70,12 @@ namespace FreeSql.Internal.CommonProvider
ret += await this.RawExecuteAffrowsAsync(cancellationToken);
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -135,7 +135,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = await _orm.Ado.MasterPool.GetAsync())
{
_transaction = conn.Value.BeginTransaction();
@@ -151,12 +151,12 @@ namespace FreeSql.Internal.CommonProvider
else ret = await this.RawExecuteIdentityAsync(cancellationToken);
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -215,7 +215,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = await _orm.Ado.MasterPool.GetAsync())
{
_transaction = conn.Value.BeginTransaction();
@@ -230,12 +230,12 @@ namespace FreeSql.Internal.CommonProvider
ret.AddRange(await this.RawExecuteInsertedAsync(cancellationToken));
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;

View File

@@ -312,7 +312,7 @@ namespace FreeSql.Internal.CommonProvider
break;
}
}
if (exp == null) throw new Exception(CoreStrings.Cannot_Match_Property(property));
if (exp == null) throw new Exception(CoreErrorStrings.Cannot_Match_Property(property));
}
else
{
@@ -333,7 +333,7 @@ namespace FreeSql.Internal.CommonProvider
{
var tmp1 = field[x];
if (_commonUtils.GetTableByEntity(currentType).Properties.TryGetValue(tmp1, out var prop) == false)
throw new ArgumentException($"{currentType.DisplayCsharp()} {CoreStrings.NotFound_PropertyName(tmp1)}");
throw new ArgumentException($"{currentType.DisplayCsharp()} {CoreErrorStrings.NotFound_PropertyName(tmp1)}");
currentType = prop.PropertyType;
currentExp = Expression.MakeMemberAccess(currentExp, prop);
}
@@ -796,7 +796,7 @@ namespace FreeSql.Internal.CommonProvider
}
public IDelete<T1> ToDelete()
{
if (_tables[0].Table.Primarys.Any() == false) throw new Exception(CoreStrings.Entity_Must_Primary_Key("ToDelete", _tables[0].Table.CsName));
if (_tables[0].Table.Primarys.Any() == false) throw new Exception(CoreErrorStrings.Entity_Must_Primary_Key("ToDelete", _tables[0].Table.CsName));
var del = (_orm as BaseDbProvider).CreateDeleteProvider<T1>(null) as DeleteProvider<T1>;
if (_tables[0].Table.Type != typeof(T1)) del.AsType(_tables[0].Table.Type);
if (_params.Any()) del._params = new List<DbParameter>(_params.ToArray());
@@ -830,7 +830,7 @@ namespace FreeSql.Internal.CommonProvider
}
public IUpdate<T1> ToUpdate()
{
if (_tables[0].Table.Primarys.Any() == false) throw new Exception(CoreStrings.Entity_Must_Primary_Key("ToUpdate", _tables[0].Table.CsName));
if (_tables[0].Table.Primarys.Any() == false) throw new Exception(CoreErrorStrings.Entity_Must_Primary_Key("ToUpdate", _tables[0].Table.CsName));
var upd = (_orm as BaseDbProvider).CreateUpdateProvider<T1>(null) as UpdateProvider<T1>;
if (_tables[0].Table.Type != typeof(T1)) upd.AsType(_tables[0].Table.Type);
if (_params.Any()) upd._params = new List<DbParameter>(_params.ToArray());
@@ -1018,10 +1018,10 @@ namespace FreeSql.Internal.CommonProvider
}
public TSelect AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("ISelect"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("ISelect"));
if (entityType == _tables[0].Table.Type) return this as TSelect;
var newtb = _commonUtils.GetTableByEntity(entityType);
_tables[0].Table = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("ISelect"));
_tables[0].Table = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("ISelect"));
if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
return this as TSelect;
}
@@ -1067,15 +1067,15 @@ namespace FreeSql.Internal.CommonProvider
{
case DynamicFilterOperator.Custom:
var fiValueCustomArray = fi.Field?.ToString().Split(new[] { ' ' }, 2);
if (fiValueCustomArray.Length != 2) throw new ArgumentException(CoreStrings.CustomFieldSeparatedBySpaces);
if (string.IsNullOrWhiteSpace(fiValueCustomArray[0])) throw new ArgumentException(CoreStrings.Custom_StaticMethodName_IsNotNull);
if (string.IsNullOrWhiteSpace(fiValueCustomArray[1])) throw new ArgumentException(CoreStrings.Custom_Reflection_IsNotNull);
if (fiValueCustomArray.Length != 2) throw new ArgumentException(CoreErrorStrings.CustomFieldSeparatedBySpaces);
if (string.IsNullOrWhiteSpace(fiValueCustomArray[0])) throw new ArgumentException(CoreErrorStrings.Custom_StaticMethodName_IsNotNull);
if (string.IsNullOrWhiteSpace(fiValueCustomArray[1])) throw new ArgumentException(CoreErrorStrings.Custom_Reflection_IsNotNull);
var fiValue1Type = Type.GetType(fiValueCustomArray[1]);
if (fiValue1Type == null) throw new ArgumentException(CoreStrings.NotFound_Reflection(fiValueCustomArray[1]));
if (fiValue1Type == null) throw new ArgumentException(CoreErrorStrings.NotFound_Reflection(fiValueCustomArray[1]));
var fiValue0Method = fiValue1Type.GetMethod(fiValueCustomArray[0], new Type[] { typeof(string) });
if (fiValue0Method == null) fiValue0Method = fiValue1Type.GetMethod(fiValueCustomArray[0], new Type[] { typeof(object), typeof(string) });
if (fiValue0Method == null) throw new ArgumentException(CoreStrings.NotFound_Static_MethodName(fiValueCustomArray[0]));
if (MethodIsDynamicFilterCustomAttribute(fiValue0Method) == false) throw new ArgumentException(CoreStrings.Custom_StaticMethodName_NotSet_DynamicFilterCustom(fiValueCustomArray[0]));
if (fiValue0Method == null) throw new ArgumentException(CoreErrorStrings.NotFound_Static_MethodName(fiValueCustomArray[0]));
if (MethodIsDynamicFilterCustomAttribute(fiValue0Method) == false) throw new ArgumentException(CoreErrorStrings.Custom_StaticMethodName_NotSet_DynamicFilterCustom(fiValueCustomArray[0]));
var fiValue0MethodReturn = fiValue0Method?.Invoke(null, fiValue0Method.GetParameters()
.Select(a => a.ParameterType == typeof(object) ? (object)this :
(a.ParameterType == typeof(string) ? (object)(fi.Value?.ToString()) : (object)null))
@@ -1126,20 +1126,20 @@ namespace FreeSql.Internal.CommonProvider
case DynamicFilterOperator.LessThanOrEqual: exp = Expression.Call(typeof(SqlExt).GetMethod("LessThanOrEqual").MakeGenericMethod(exp.Type), exp, Expression.Constant(Utils.GetDataReaderValue(exp.Type, fi.Value?.ToString()), exp.Type)); break;
case DynamicFilterOperator.Range:
var fiValueRangeArray = getFiListValue();
if (fiValueRangeArray.Length != 2) throw new ArgumentException(CoreStrings.Range_Comma_Separateda_By2Char);
if (fiValueRangeArray.Length != 2) throw new ArgumentException(CoreErrorStrings.Range_Comma_Separateda_By2Char);
exp = Expression.AndAlso(
Expression.GreaterThanOrEqual(exp, Expression.Constant(Utils.GetDataReaderValue(exp.Type, fiValueRangeArray[0]), exp.Type)),
Expression.LessThan(exp, Expression.Constant(Utils.GetDataReaderValue(exp.Type, fiValueRangeArray[1]), exp.Type)));
break;
case DynamicFilterOperator.DateRange:
var fiValueDateRangeArray = getFiListValue();
if (fiValueDateRangeArray?.Length != 2) throw new ArgumentException(CoreStrings.DateRange_Comma_Separateda_By2Char);
if (fiValueDateRangeArray?.Length != 2) throw new ArgumentException(CoreErrorStrings.DateRange_Comma_Separateda_By2Char);
if (Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?[\-/]\d\d?$")) fiValueDateRangeArray[1] = DateTime.Parse(fiValueDateRangeArray[1]).AddDays(1).ToString("yyyy-MM-dd HH:mm:ss");
else if (Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?$")) fiValueDateRangeArray[1] = DateTime.Parse($"{fiValueDateRangeArray[1]}-01").AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
else if (Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d$")) fiValueDateRangeArray[1] = DateTime.Parse($"{fiValueDateRangeArray[1]}-01-01").AddYears(1).ToString("yyyy-MM-dd HH:mm:ss");
else if (Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?[\-/]\d\d? \d\d?$")) fiValueDateRangeArray[1] = DateTime.Parse($"{fiValueDateRangeArray[1]}:00:00").AddHours(1).ToString("yyyy-MM-dd HH:mm:ss");
else if (Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?[\-/]\d\d? \d\d?:\d\d?$")) fiValueDateRangeArray[1] = DateTime.Parse($"{fiValueDateRangeArray[1]}:00").AddMinutes(1).ToString("yyyy-MM-dd HH:mm:ss");
else if (!Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?[\-/]\d\d? \d\d?:\d\d?:\d\d?$")) throw new ArgumentException(CoreStrings.DateRange_DateFormat_yyyy);
else if (!Regex.IsMatch(fiValueDateRangeArray[1], @"^\d\d\d\d[\-/]\d\d?[\-/]\d\d? \d\d?:\d\d?:\d\d?$")) throw new ArgumentException(CoreErrorStrings.DateRange_DateFormat_yyyy);
if (Regex.IsMatch(fiValueDateRangeArray[0], @"^\d\d\d\d[\-/]\d\d?$")) fiValueDateRangeArray[0] = DateTime.Parse($"{fiValueDateRangeArray[0]}-01").ToString("yyyy-MM-dd HH:mm:ss");
else if (Regex.IsMatch(fiValueDateRangeArray[0], @"^\d\d\d\d$")) fiValueDateRangeArray[0] = DateTime.Parse($"{fiValueDateRangeArray[0]}-01-01").ToString("yyyy-MM-dd HH:mm:ss");
@@ -1274,7 +1274,7 @@ namespace FreeSql.Internal.CommonProvider
{
if (_transaction == null && _orm.Ado.TransactionCurrentThread != null) this.WithTransaction(_orm.Ado.TransactionCurrentThread);
if (_transaction == null && _resolveHookTransaction != null) this.WithTransaction(_resolveHookTransaction());
if (_transaction == null) throw new Exception($"{CoreStrings.Begin_Transaction_Then_ForUpdate}");
if (_transaction == null) throw new Exception($"{CoreErrorStrings.Begin_Transaction_Then_ForUpdate}");
switch (_orm.Ado.DataType)
{
case DataType.MySql:

View File

@@ -21,13 +21,13 @@ namespace FreeSql.Internal.CommonProvider
{
public DataTable ToDataTableByPropertyName(string[] properties)
{
if (properties?.Any() != true) throw new ArgumentException($"{CoreStrings.Properties_Cannot_Null}");
if (properties?.Any() != true) throw new ArgumentException($"{CoreErrorStrings.Properties_Cannot_Null}");
var sbfield = new StringBuilder();
for (var propIdx = 0; propIdx < properties.Length; propIdx++)
{
var property = properties[propIdx];
var exp = ConvertStringPropertyToExpression(property);
if (exp == null) throw new Exception(CoreStrings.Property_Cannot_Find(property));
if (exp == null) throw new Exception(CoreErrorStrings.Property_Cannot_Find(property));
var field = _commonExpression.ExpressionSelectColumn_MemberAccess(_tables, _tableRule, null, SelectTableInfoType.From, exp, true, _diymemexpWithTempQuery);
if (propIdx > 0) sbfield.Append(", ");
sbfield.Append(field);
@@ -236,7 +236,7 @@ namespace FreeSql.Internal.CommonProvider
}
public void ToChunk(int size, Action<FetchCallbackArgs<List<T1>>> done, bool includeNestedMembers = false)
{
if (_selectExpression != null) throw new ArgumentException(CoreStrings.Before_Chunk_Cannot_Use_Select);
if (_selectExpression != null) throw new ArgumentException(CoreErrorStrings.Before_Chunk_Cannot_Use_Select);
this.ToListChunkPrivate(size, done, includeNestedMembers == false ? this.GetAllFieldExpressionTreeLevel2() : this.GetAllFieldExpressionTreeLevelAll(), null);
}
@@ -859,7 +859,7 @@ namespace FreeSql.Internal.CommonProvider
protected TSelect InternalJoin<T2>(Expression exp, SelectTableInfoType joinType)
{
var tb = _commonUtils.GetTableByEntity(typeof(T2));
if (tb == null) throw new ArgumentException(CoreStrings.T2_Type_Error);
if (tb == null) throw new ArgumentException(CoreErrorStrings.T2_Type_Error);
_tables.Add(new SelectTableInfo { Table = tb, Alias = $"IJ{_tables.Count}", On = null, Type = joinType });
_commonExpression.ExpressionJoinLambda(_tables, _tableRule, joinType, exp, _diymemexpWithTempQuery, _whereGlobalFilter);
return this as TSelect;
@@ -990,7 +990,7 @@ namespace FreeSql.Internal.CommonProvider
protected string InternalGetInsertIntoToSql<TTargetEntity>(string tableName, Expression select)
{
var tb = _orm.CodeFirst.GetTableByEntity(typeof(TTargetEntity));
if (tb == null) throw new ArgumentException(CoreStrings.InsertInto_TypeError(typeof(TTargetEntity).DisplayCsharp()));
if (tb == null) throw new ArgumentException(CoreErrorStrings.InsertInto_TypeError(typeof(TTargetEntity).DisplayCsharp()));
if (string.IsNullOrEmpty(tableName)) tableName = tb.DbName;
if (_orm.CodeFirst.IsSyncStructureToLower) tableName = tableName.ToLower();
if (_orm.CodeFirst.IsSyncStructureToUpper) tableName = tableName.ToUpper();
@@ -1003,7 +1003,7 @@ namespace FreeSql.Internal.CommonProvider
_commonExpression.ReadAnonymousField(_tables, _tableRule, field, map, ref index, select, null, _diymemexpWithTempQuery, _whereGlobalFilter, null, null, false); //不走 DTO 映射,不处理 IncludeMany
var childs = map.Childs;
if (childs.Any() == false) throw new ArgumentException(CoreStrings.InsertInto_No_Property_Selected(typeof(TTargetEntity).DisplayCsharp()));
if (childs.Any() == false) throw new ArgumentException(CoreErrorStrings.InsertInto_No_Property_Selected(typeof(TTargetEntity).DisplayCsharp()));
foreach (var col in tb.Columns.Values)
{
if (col.Attribute.IsIdentity && string.IsNullOrEmpty(col.DbInsertValue)) continue;
@@ -1101,13 +1101,13 @@ namespace FreeSql.Internal.CommonProvider
#else
public Task<DataTable> ToDataTableByPropertyNameAsync(string[] properties, CancellationToken cancellationToken)
{
if (properties?.Any() != true) throw new ArgumentException($"{CoreStrings.Properties_Cannot_Null}");
if (properties?.Any() != true) throw new ArgumentException($"{CoreErrorStrings.Properties_Cannot_Null}");
var sbfield = new StringBuilder();
for (var propIdx = 0; propIdx < properties.Length; propIdx++)
{
var property = properties[propIdx];
var exp = ConvertStringPropertyToExpression(property);
if (exp == null) throw new Exception(CoreStrings.Property_Cannot_Find(property));
if (exp == null) throw new Exception(CoreErrorStrings.Property_Cannot_Find(property));
var field = _commonExpression.ExpressionSelectColumn_MemberAccess(_tables, _tableRule, null, SelectTableInfoType.From, exp, true, _diymemexpWithTempQuery);
if (propIdx > 0) sbfield.Append(", ");
sbfield.Append(field);

View File

@@ -31,7 +31,7 @@ namespace FreeSql.Internal.CommonProvider
for (var a = 1; a < lambdaExp.Parameters.Count; a++)
{
var tb = _commonUtils.GetTableByEntity(lambdaExp.Parameters[a].Type);
if (tb == null) throw new ArgumentException(CoreStrings.Type_Error_Name(lambdaExp.Parameters[a].Name));
if (tb == null) throw new ArgumentException(CoreErrorStrings.Type_Error_Name(lambdaExp.Parameters[a].Name));
_tables.Add(new SelectTableInfo { Table = tb, Alias = lambdaExp.Parameters[a].Name, On = null, Type = SelectTableInfoType.From });
}
var exp = lambdaExp.Body;
@@ -79,7 +79,7 @@ namespace FreeSql.Internal.CommonProvider
case "LeftJoin": this.InternalJoin(expCall.Arguments[0], SelectTableInfoType.LeftJoin); break;
case "InnerJoin": this.InternalJoin(expCall.Arguments[0], SelectTableInfoType.InnerJoin); break;
case "RightJoin": this.InternalJoin(expCall.Arguments[0], SelectTableInfoType.RightJoin); break;
default: throw new NotImplementedException(CoreStrings.Not_Implemented_Name(expCall.Method.Name));
default: throw new NotImplementedException(CoreErrorStrings.Not_Implemented_Name(expCall.Method.Name));
}
}
}
@@ -528,7 +528,7 @@ namespace FreeSql.Internal.CommonProvider
public ISelect<T1> WithMemory(IEnumerable<T1> source)
{
var list = source?.Select(a => (object)a).ToList();
if (list.Any() != true) throw new Exception(CoreStrings.Cannot_Be_NULL_Name(nameof(source)));
if (list.Any() != true) throw new Exception(CoreErrorStrings.Cannot_Be_NULL_Name(nameof(source)));
var sb = new StringBuilder();
(_orm.InsertOrUpdate<object>().AsType(_tables[0].Table.Type) as InsertOrUpdateProvider<object>)
.WriteSourceSelectUnionAll(list, sb, _params, true);
@@ -563,13 +563,13 @@ namespace FreeSql.Internal.CommonProvider
public ISelect<T1> IncludeByPropertyName(string property, Expression<Action<ISelect<object>>> then)
{
var exp = ConvertStringPropertyToExpression(property, true);
if (exp == null) throw new ArgumentException($"{CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property))}");
if (exp == null) throw new ArgumentException($"{CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property))}");
var memExp = exp as MemberExpression;
if (memExp == null) throw new ArgumentException($"{CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property))}2");
if (memExp == null) throw new ArgumentException($"{CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property))}2");
var parTb = _commonUtils.GetTableByEntity(memExp.Expression.Type);
if (parTb == null) throw new ArgumentException($"{CoreStrings.Cannot_Resolve_ExpressionTree(nameof(property))}3");
if (parTb == null) throw new ArgumentException($"{CoreErrorStrings.Cannot_Resolve_ExpressionTree(nameof(property))}3");
var parTbref = parTb.GetTableRef(memExp.Member.Name, true, true);
if (parTbref == null) throw new ArgumentException(CoreStrings.Not_Valid_Navigation_Property(nameof(property)));
if (parTbref == null) throw new ArgumentException(CoreErrorStrings.Not_Valid_Navigation_Property(nameof(property)));
switch (parTbref.RefType)
{
case TableRefType.ManyToMany:
@@ -584,7 +584,7 @@ namespace FreeSql.Internal.CommonProvider
}
var navigateSelector = Expression.Lambda(funcType, exp, _tables[0].Parameter);
var incMethod = this.GetType().GetMethod("IncludeMany");
if (incMethod == null) throw new Exception(CoreStrings.RunTimeError_Reflection_IncludeMany);
if (incMethod == null) throw new Exception(CoreErrorStrings.RunTimeError_Reflection_IncludeMany);
Delegate newthen = null;
if (then != null)
{
@@ -648,10 +648,10 @@ namespace FreeSql.Internal.CommonProvider
{
var expBody = navigateSelector?.Body;
if (expBody == null) return this;
if (expBody.NodeType != ExpressionType.MemberAccess) throw new Exception(CoreStrings.Include_ParameterType_Error_Use_MemberAccess);
if (typeof(IEnumerable).IsAssignableFrom(expBody.Type)) throw new Exception(CoreStrings.Include_ParameterType_Error_Use_IncludeMany);
if (expBody.NodeType != ExpressionType.MemberAccess) throw new Exception(CoreErrorStrings.Include_ParameterType_Error_Use_MemberAccess);
if (typeof(IEnumerable).IsAssignableFrom(expBody.Type)) throw new Exception(CoreErrorStrings.Include_ParameterType_Error_Use_IncludeMany);
var tb = _commonUtils.GetTableByEntity(expBody.Type);
if (tb == null) throw new Exception(CoreStrings.Include_ParameterType_Error);
if (tb == null) throw new Exception(CoreErrorStrings.Include_ParameterType_Error);
_isIncluded = true;
_tables[0].Parameter = navigateSelector.Parameters[0];
@@ -686,19 +686,19 @@ namespace FreeSql.Internal.CommonProvider
isbreak = true;
break;
}
throw new Exception(CoreStrings.Expression_Error_Use_Successive_MemberAccess_Type(exp));
throw new Exception(CoreErrorStrings.Expression_Error_Use_Successive_MemberAccess_Type(exp));
default:
throw new Exception(CoreStrings.Expression_Error_Use_Successive_MemberAccess_Type(exp));
throw new Exception(CoreErrorStrings.Expression_Error_Use_Successive_MemberAccess_Type(exp));
}
}
if (param == null) throw new Exception(CoreStrings.Expression_Error_Use_ParameterExpression(exp));
if (param == null) throw new Exception(CoreErrorStrings.Expression_Error_Use_ParameterExpression(exp));
return NativeTuple.Create(param, members.ToList());
}
static MethodInfo GetEntityValueWithPropertyNameMethod = typeof(EntityUtilExtensions).GetMethod("GetEntityValueWithPropertyName");
static ConcurrentDictionary<Type, ConcurrentDictionary<string, MethodInfo>> _dicTypeMethod = new ConcurrentDictionary<Type, ConcurrentDictionary<string, MethodInfo>>();
public ISelect<T1> IncludeMany<TNavigate>(Expression<Func<T1, IEnumerable<TNavigate>>> navigateSelector, Action<ISelect<TNavigate>> then = null) where TNavigate : class
{
var throwNavigateSelector = new Exception(CoreStrings.IncludeMany_ParameterType_Error_Use_MemberAccess);
var throwNavigateSelector = new Exception(CoreErrorStrings.IncludeMany_ParameterType_Error_Use_MemberAccess);
var expBody = navigateSelector?.Body;
if (expBody == null) return this;
@@ -708,7 +708,7 @@ namespace FreeSql.Internal.CommonProvider
Expression<Func<TNavigate, TNavigate>> selectExp = null;
while (expBody.NodeType == ExpressionType.Call)
{
throwNavigateSelector = new Exception(CoreStrings.IncludeMany_ParameterTypeError(nameof(navigateSelector)));
throwNavigateSelector = new Exception(CoreErrorStrings.IncludeMany_ParameterTypeError(nameof(navigateSelector)));
var callExp = (expBody as MethodCallExpression);
switch (callExp.Method.Name)
{
@@ -720,7 +720,7 @@ namespace FreeSql.Internal.CommonProvider
break;
case "Select":
selectExp = (callExp.Arguments[1] as Expression<Func<TNavigate, TNavigate>>);
if (selectExp?.Parameters.Count != 1) throw new Exception(CoreStrings.IncludeMany_ParameterError_OnlyUseOneParameter(nameof(navigateSelector)));
if (selectExp?.Parameters.Count != 1) throw new Exception(CoreErrorStrings.IncludeMany_ParameterError_OnlyUseOneParameter(nameof(navigateSelector)));
break;
default: throw throwNavigateSelector;
}
@@ -736,9 +736,9 @@ namespace FreeSql.Internal.CommonProvider
if (tb == null) throw throwNavigateSelector;
var collMemElementType = (collMem.Type.IsGenericType ? collMem.Type.GetGenericArguments().FirstOrDefault() : collMem.Type.GetElementType());
if (typeof(TNavigate) != collMemElementType)
throw new Exception(CoreStrings.IncludeMany_ParameterError_Select_ReturnConsistentType(nameof(navigateSelector), collMemElementType));
throw new Exception(CoreErrorStrings.IncludeMany_ParameterError_Select_ReturnConsistentType(nameof(navigateSelector), collMemElementType));
var tbNav = _commonUtils.GetTableByEntity(typeof(TNavigate));
if (tbNav == null) throw new Exception(CoreStrings.TypeError_CannotUse_IncludeMany(typeof(TNavigate).FullName));
if (tbNav == null) throw new Exception(CoreErrorStrings.TypeError_CannotUse_IncludeMany(typeof(TNavigate).FullName));
if (collMem.Expression.NodeType != ExpressionType.Parameter)
_commonExpression.ExpressionWhereLambda(_tables, _tableRule, Expression.MakeMemberAccess(collMem.Expression, tb.Properties[tb.ColumnsByCs.First().Value.CsName]), _diymemexpWithTempQuery, null, null);
@@ -748,7 +748,7 @@ namespace FreeSql.Internal.CommonProvider
if (whereExp == null)
{
tbref = tb.GetTableRef(collMem.Member.Name, true, true);
if (tbref == null) throw new Exception(CoreStrings.IncludeMany_NotValid_Navigation(tb.Type.DisplayCsharp(), collMem.Member.Name));
if (tbref == null) throw new Exception(CoreErrorStrings.IncludeMany_NotValid_Navigation(tb.Type.DisplayCsharp(), collMem.Member.Name));
}
else
{

View File

@@ -197,7 +197,7 @@ namespace FreeSql.Internal.CommonProvider
public string InternalToSql(string field)
{
if (string.IsNullOrEmpty(field))
throw new ArgumentException(CoreStrings.Parameter_Field_NotSpecified);
throw new ArgumentException(CoreErrorStrings.Parameter_Field_NotSpecified);
var isNestedPageSql = false;
switch (_orm.Ado.DataType)

View File

@@ -224,7 +224,7 @@ namespace FreeSql.Internal.CommonProvider
{
var ctor = typeof(UpdateJoinProvider<,>).MakeGenericType(typeof(T1), typeof(T2))
.GetConstructor(new[] { typeof(IUpdate<T1>), typeof(ISelect<T2>), typeof(Expression<Func<T1, T2, bool>>) });
if (ctor == null) throw new Exception(CoreStrings.Type_Cannot_Access_Constructor("UpdateJoinProvider<>"));
if (ctor == null) throw new Exception(CoreErrorStrings.Type_Cannot_Access_Constructor("UpdateJoinProvider<>"));
return ctor.Invoke(new object[] { this, query, on }) as IUpdateJoin<T1, T2>;
}
@@ -271,7 +271,7 @@ namespace FreeSql.Internal.CommonProvider
if (_versionColumn != null && _source.Count > 0)
{
if (affrows != _source.Count)
throw new DbUpdateVersionException(CoreStrings.DbUpdateVersionException_RowLevelOptimisticLock(_source.Count, affrows), _table, sql, dbParms, affrows, _source.Select(a => (object)a));
throw new DbUpdateVersionException(CoreErrorStrings.DbUpdateVersionException_RowLevelOptimisticLock(_source.Count, affrows), _table, sql, dbParms, affrows, _source.Select(a => (object)a));
foreach (var d in _source)
{
if (d is Dictionary<string, object> dict)
@@ -381,7 +381,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = _orm.Ado.MasterPool.Get())
{
_transaction = conn.Value.BeginTransaction();
@@ -396,12 +396,12 @@ namespace FreeSql.Internal.CommonProvider
execute();
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;
@@ -537,7 +537,7 @@ namespace FreeSql.Internal.CommonProvider
if (orm.Aop.AuditValueHandler == null) return;
if (data == null || table == null) return;
if (typeof(T1) == typeof(object) && new[] { table.Type, table.TypeLazy }.Contains(data.GetType()) == false)
throw new Exception(CoreStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
throw new Exception(CoreErrorStrings.DataType_AsType_Inconsistent(data.GetType().DisplayCsharp(), table.Type.DisplayCsharp()));
foreach (var col in table.Columns.Values)
{
object val = col.GetValue(data);
@@ -692,7 +692,7 @@ namespace FreeSql.Internal.CommonProvider
if (initAssignExp == null) continue;
var memberName = initExp.Bindings[a].Member.Name;
if (_table.ColumnsByCsIgnore.ContainsKey(memberName)) continue;
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception(CoreStrings.NotFound_Property(memberName));
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception(CoreErrorStrings.NotFound_Property(memberName));
var memberValue = _commonExpression.ExpressionLambdaToSql(initAssignExp.Expression, new CommonExpression.ExpTSC
{
isQuoteName = true,
@@ -710,7 +710,7 @@ namespace FreeSql.Internal.CommonProvider
{
var memberName = newExp.Members[a].Name;
if (_table.ColumnsByCsIgnore.ContainsKey(memberName)) continue;
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception(CoreStrings.NotFound_Property(memberName));
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception(CoreErrorStrings.NotFound_Property(memberName));
var memberValue = _commonExpression.ExpressionLambdaToSql(newExp.Arguments[a], new CommonExpression.ExpTSC
{
isQuoteName = true,
@@ -831,7 +831,7 @@ namespace FreeSql.Internal.CommonProvider
protected string WhereCaseSource(string CsName, Func<string, string> thenValue)
{
if (_source.Any() == false) return null;
if (_table.ColumnsByCs.ContainsKey(CsName) == false) throw new Exception(CoreStrings.NotFound_CsName_Column(CsName));
if (_table.ColumnsByCs.ContainsKey(CsName) == false) throw new Exception(CoreErrorStrings.NotFound_CsName_Column(CsName));
if (thenValue == null) throw new ArgumentNullException(nameof(thenValue));
if (_source.Count == 0) return null;
@@ -928,10 +928,10 @@ namespace FreeSql.Internal.CommonProvider
}
public IUpdate<T1> AsType(Type entityType)
{
if (entityType == typeof(object)) throw new Exception(CoreStrings.TypeAsType_NotSupport_Object("IUpdate"));
if (entityType == typeof(object)) throw new Exception(CoreErrorStrings.TypeAsType_NotSupport_Object("IUpdate"));
if (entityType == _table.Type) return this;
var newtb = _commonUtils.GetTableByEntity(entityType);
_table = newtb ?? throw new Exception(CoreStrings.Type_AsType_Parameter_Error("IUpdate"));
_table = newtb ?? throw new Exception(CoreErrorStrings.Type_AsType_Parameter_Error("IUpdate"));
_tempPrimarys = _table.Primarys;
_versionColumn = _ignoreVersion ? null : _table.VersionColumn;
if (_isAutoSyncStructure) _orm.CodeFirst.SyncStructure(entityType);
@@ -1228,7 +1228,7 @@ namespace FreeSql.Internal.CommonProvider
sb.Append(" \r\nWHERE ");
if (_source.Any())
{
if (_tempPrimarys.Any() == false) throw new ArgumentException(CoreStrings.NoPrimaryKey_UseSetDto(_table.Type.DisplayCsharp()));
if (_tempPrimarys.Any() == false) throw new ArgumentException(CoreErrorStrings.NoPrimaryKey_UseSetDto(_table.Type.DisplayCsharp()));
sb.Append('(').Append(_commonUtils.WhereItems(_tempPrimarys, "", _source, _paramsSource)).Append(')');
andTimes++;
}

View File

@@ -50,7 +50,7 @@ namespace FreeSql.Internal.CommonProvider
}
else
{
if (_orm.Ado.MasterPool == null) throw new Exception(CoreStrings.MasterPool_IsNull_UseTransaction);
if (_orm.Ado.MasterPool == null) throw new Exception(CoreErrorStrings.MasterPool_IsNull_UseTransaction);
using (var conn = await _orm.Ado.MasterPool.GetAsync())
{
_transaction = conn.Value.BeginTransaction();
@@ -65,12 +65,12 @@ namespace FreeSql.Internal.CommonProvider
await executeAsync();
}
_transaction.Commit();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.Commit, null));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.Commit, null));
}
catch (Exception ex)
{
_transaction.Rollback();
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreStrings.RollBack, ex));
_orm.Aop.TraceAfterHandler?.Invoke(this, new Aop.TraceAfterEventArgs(transBefore, CoreErrorStrings.RollBack, ex));
throw;
}
_transaction = null;

File diff suppressed because it is too large Load Diff

View File

@@ -113,7 +113,7 @@ namespace FreeSql.Internal
else colattr.IsIgnore = true;
//Navigate 错误提示
var pnvAttr = common.GetEntityNavigateAttribute(trytb.Type, p);
if (pnvAttr != null) throw new Exception(CoreStrings.Navigation_Missing_SetProperty(trytb.Type.DisplayCsharp(), p.Name));
if (pnvAttr != null) throw new Exception(CoreErrorStrings.Navigation_Missing_SetProperty(trytb.Type.DisplayCsharp(), p.Name));
}
if (tp == null && colattr?.IsIgnore != true)
{
@@ -153,7 +153,7 @@ namespace FreeSql.Internal
StringBuilder cscode = null;
if (common.CodeFirst.IsLazyLoading && propsLazy.Any())
{
if (trytb.Type.IsPublic == false && trytb.Type.IsNestedPublic == false) throw new Exception(CoreStrings.LazyLoading_EntityMustDeclarePublic(trytbTypeName));
if (trytb.Type.IsPublic == false && trytb.Type.IsNestedPublic == false) throw new Exception(CoreErrorStrings.LazyLoading_EntityMustDeclarePublic(trytbTypeName));
trytbTypeLazyName = $"FreeSqlLazyEntity__{Regex.Replace(trytbTypeName, @"[^\w\d]", "_")}";
@@ -179,14 +179,14 @@ namespace FreeSql.Internal
{
cscode.AppendLine("}");
Assembly assembly = null;
if (MethodLazyLoadingComplier.Value == null) throw new Exception(CoreStrings.Install_FreeSql_Extensions_LazyLoading);
if (MethodLazyLoadingComplier.Value == null) throw new Exception(CoreErrorStrings.Install_FreeSql_Extensions_LazyLoading);
try
{
assembly = MethodLazyLoadingComplier.Value.Invoke(null, new object[] { cscode.ToString() }) as Assembly;
}
catch (Exception ex)
{
throw new Exception(CoreStrings.LazyLoading_CompilationError(trytbTypeName, ex.Message, cscode));
throw new Exception(CoreErrorStrings.LazyLoading_CompilationError(trytbTypeName, ex.Message, cscode));
}
var type = assembly.GetExportedTypes()/*.DefinedTypes*/.Where(a => a.FullName.EndsWith(trytbTypeLazyName)).FirstOrDefault();
trytb.TypeLazy = type;
@@ -503,8 +503,8 @@ namespace FreeSql.Internal
colattr.DbType = Regex.Replace(colattr.DbType, decimalPatten, $"$1({colattr.Precision},{colattr.Scale})");
}
if (trytb.Columns.ContainsKey(colattr.Name)) throw new Exception(CoreStrings.Duplicate_ColumnAttribute(colattr.Name));
if (trytb.ColumnsByCs.ContainsKey(csName)) throw new Exception(CoreStrings.Duplicate_PropertyName(csName));
if (trytb.Columns.ContainsKey(colattr.Name)) throw new Exception(CoreErrorStrings.Duplicate_ColumnAttribute(colattr.Name));
if (trytb.ColumnsByCs.ContainsKey(csName)) throw new Exception(CoreErrorStrings.Duplicate_PropertyName(csName));
return col;
}
@@ -515,7 +515,7 @@ namespace FreeSql.Internal
{
if (trytb.VersionColumn.Attribute.MapType.IsNullableType() ||
trytb.VersionColumn.Attribute.MapType.IsNumberType() == false && !new[] { typeof(byte[]), typeof(string) }.Contains(trytb.VersionColumn.Attribute.MapType))
throw new Exception(CoreStrings.Properties_AsRowLock_Must_Numeric_Byte(trytb.VersionColumn.CsName));
throw new Exception(CoreErrorStrings.Properties_AsRowLock_Must_Numeric_Byte(trytb.VersionColumn.CsName));
}
tbattr?.ParseAsTable(trytb);
@@ -800,7 +800,7 @@ namespace FreeSql.Internal
{
if (locTb.ColumnsByCs.TryGetValue(bi, out var trybindcol) == false)
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, locFindTypeName, bi));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, locFindTypeName, bi));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -820,7 +820,7 @@ namespace FreeSql.Internal
{
if (bindColumnsTempPrimary[a].CsType.NullableTypeOrThis() != bindColumns[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.OneToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, bindColumnsTempPrimary[a].CsName, tbref.CsName, bindColumns[a].CsName));
nvref.Exception = new Exception(CoreErrorStrings.OneToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, bindColumnsTempPrimary[a].CsName, tbref.CsName, bindColumns[a].CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -852,7 +852,7 @@ namespace FreeSql.Internal
{
if (bindColumns[a].CsType.NullableTypeOrThis() != bindColumnsTempPrimary[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, bindColumns[a].CsName, tbref.CsName, bindColumnsTempPrimary[a].CsName));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, bindColumns[a].CsName, tbref.CsName, bindColumnsTempPrimary[a].CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -883,7 +883,7 @@ namespace FreeSql.Internal
if (typeof(IEnumerable).IsAssignableFrom(pnv.PropertyType) == false) return;
if (trytb.Primarys.Any() == false)
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_EntityMissingPrimaryKey(trytbTypeName, pnv.Name, trytbTypeName));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_EntityMissingPrimaryKey(trytbTypeName, pnv.Name, trytbTypeName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
return;
@@ -916,7 +916,7 @@ namespace FreeSql.Internal
if (isManyToMany == false)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_EntityMustHas_NavigateCollection(trytbTypeName, pnv.Name, tbrefTypeName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_EntityMustHas_NavigateCollection(trytbTypeName, pnv.Name, tbrefTypeName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
return;
@@ -939,7 +939,7 @@ namespace FreeSql.Internal
{
if (tbref.Primarys.Any() == false)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_EntityMissing_PrimaryKey(trytbTypeName, pnv.Name, tbrefTypeName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_EntityMissing_PrimaryKey(trytbTypeName, pnv.Name, tbrefTypeName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
return;
@@ -1010,7 +1010,7 @@ namespace FreeSql.Internal
}
catch (Exception ex)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, ex.Message));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, ex.Message));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1018,7 +1018,7 @@ namespace FreeSql.Internal
{
if (trytbTf.RefType != TableRefType.ManyToOne && trytbTf.RefType != TableRefType.OneToOne)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1057,7 +1057,7 @@ namespace FreeSql.Internal
}
catch (Exception ex)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTbref.Name, ex.Message));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_IntermediateClass_ErrorMessage(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTbref.Name, ex.Message));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1065,7 +1065,7 @@ namespace FreeSql.Internal
{
if (tbrefTf.RefType != TableRefType.ManyToOne && tbrefTf.RefType != TableRefType.OneToOne)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTbref.Name));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTbref.Name));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1103,14 +1103,14 @@ namespace FreeSql.Internal
}
if (trycol != null && trycol.CsType.NullableTypeOrThis() != trytb.Primarys[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, tbmid.CsName, trycol.CsName, trytb.CsName, trytb.Primarys[a].CsName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, tbmid.CsName, trycol.CsName, trytb.CsName, trytb.Primarys[a].CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
}
if (trycol == null)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, findtrytbPkCsName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, findtrytbPkCsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -1143,14 +1143,14 @@ namespace FreeSql.Internal
}
if (trycol != null && trycol.CsType.NullableTypeOrThis() != tbref.Primarys[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, tbmid.CsName, trycol.CsName, trytb.CsName, trytb.Primarys[a].CsName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, tbmid.CsName, trycol.CsName, trytb.CsName, trytb.Primarys[a].CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
}
if (trycol == null)
{
nvref.Exception = new Exception(CoreStrings.ManyToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, findtbrefPkCsName));
nvref.Exception = new Exception(CoreErrorStrings.ManyToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbmid.CsName, midTypePropsTrytb.Name, findtbrefPkCsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -1356,7 +1356,7 @@ namespace FreeSql.Internal
{
if (tbref.ColumnsByCs.TryGetValue(bi, out var trybindcol) == false)
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, tbrefTypeName, bi));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, tbrefTypeName, bi));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -1370,7 +1370,7 @@ namespace FreeSql.Internal
if (nvref.Exception == null && bindColumns.Any() && bindColumns.Count != trytb.Primarys.Length)
{
nvref.Exception = new Exception(CoreStrings.Navigation_Bind_Number_Different(trytbTypeName, pnv.Name, bindColumns.Count, trytb.Primarys.Length));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_Bind_Number_Different(trytbTypeName, pnv.Name, bindColumns.Count, trytb.Primarys.Length));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1410,15 +1410,15 @@ namespace FreeSql.Internal
}
if (trycol != null && trycol.CsType.NullableTypeOrThis() != trytb.Primarys[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.OneToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, trytb.Primarys[a].CsName, tbref.CsName, trycol.CsName));
nvref.Exception = new Exception(CoreErrorStrings.OneToMany_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, trytb.Primarys[a].CsName, tbref.CsName, trycol.CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
}
if (trycol == null)
{
nvref.Exception = new Exception(CoreStrings.OneToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbref.CsName, findtrytb, findtrytbPkCsName)
+ (refprop == null ? "" : CoreStrings.OneToMany_UseNavigate(refprop.Name, findtrytbPkCsName)));
nvref.Exception = new Exception(CoreErrorStrings.OneToMany_NotFound_CorrespondingField(trytbTypeName, pnv.Name, tbref.CsName, findtrytb, findtrytbPkCsName)
+ (refprop == null ? "" : CoreErrorStrings.OneToMany_UseNavigate(refprop.Name, findtrytbPkCsName)));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -1462,7 +1462,7 @@ namespace FreeSql.Internal
if (tbref == null) return;
if (tbref.Primarys.Any() == false)
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_EntityMissingPrimaryKey(trytbTypeName, pnv.Name, propTypeName));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_EntityMissingPrimaryKey(trytbTypeName, pnv.Name, propTypeName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1479,7 +1479,7 @@ namespace FreeSql.Internal
{
if (trytb.ColumnsByCs.TryGetValue(bi, out var trybindcol) == false)
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, trytbTypeName, bi));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_NotFound_Property(trytbTypeName, pnv.Name, trytbTypeName, bi));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -1491,7 +1491,7 @@ namespace FreeSql.Internal
if (nvref.Exception == null && bindColumns.Any() && bindColumns.Count != tbref.Primarys.Length)
{
nvref.Exception = new Exception(CoreStrings.Navigation_Bind_Number_Different(trytbTypeName, pnv.Name, bindColumns.Count, tbref.Primarys.Length));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_Bind_Number_Different(trytbTypeName, pnv.Name, bindColumns.Count, tbref.Primarys.Length));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
}
@@ -1546,14 +1546,14 @@ namespace FreeSql.Internal
}
if (trycol != null && trycol.CsType.NullableTypeOrThis() != tbref.Primarys[a].CsType.NullableTypeOrThis())
{
nvref.Exception = new Exception(CoreStrings.Navigation_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, trycol.CsName, tbref.CsName, tbref.Primarys[a].CsName));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_ParsingError_InconsistentType(trytbTypeName, pnv.Name, trytb.CsName, trycol.CsName, tbref.CsName, tbref.Primarys[a].CsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
}
if (trycol == null)
{
nvref.Exception = new Exception(CoreStrings.Navigation_NotFound_CorrespondingField(trytbTypeName, pnv.Name, findtbrefPkCsName));
nvref.Exception = new Exception(CoreErrorStrings.Navigation_NotFound_CorrespondingField(trytbTypeName, pnv.Name, findtbrefPkCsName));
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
//if (isLazy) throw nvref.Exception;
break;
@@ -2121,7 +2121,7 @@ namespace FreeSql.Internal
var parmValue = Expression.Parameter(typeof(object), "value");
Expression exp = Expression.Convert(parmInfo, typeObj);
foreach (var pro in memberAccessPath.Split('.'))
exp = Expression.PropertyOrField(exp, pro) ?? throw new Exception(string.Concat(exp.Type.FullName, CoreStrings.NoProperty_Defined, pro));
exp = Expression.PropertyOrField(exp, pro) ?? throw new Exception(string.Concat(exp.Type.FullName, CoreErrorStrings.NoProperty_Defined, pro));
var value2 = Expression.Call(MethodGetDataReaderValue, Expression.Constant(exp.Type), parmValue);
var value3 = Expression.Convert(parmValue, typeValue);
@@ -2761,7 +2761,7 @@ namespace FreeSql.Internal
}
catch (Exception ex)
{
throw new ArgumentException(CoreStrings.ExpressionTree_Convert_Type_Error(string.Concat(value), value.GetType().FullName, type.FullName, ex.Message));
throw new ArgumentException(CoreErrorStrings.ExpressionTree_Convert_Type_Error(string.Concat(value), value.GetType().FullName, type.FullName, ex.Message));
}
}
public static string GetCsName(string name)

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
<#
Session["ResourceFile"] = "CoreStrings.resx";
Session["AccessModifier"] = "public";
#>
<#@ include file="Resources.tt" #>

View File

@@ -1,603 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AsTable_PropertyName_FormatError" xml:space="preserve">
<value>FreeSql: [Table(AsTable="{asTable}")] Property value formatted incorrectly</value>
</data>
<data name="AsTable_PropertyName_NotDateTime" xml:space="preserve">
<value>FreeSql: The property name {atmGroupsValue} set by [Table (AsTable = xx)] is not of type DateTime</value>
</data>
<data name="Available_Failed_Get_Resource" xml:space="preserve">
<value>FreeSql: {name}: Failed to get resource {statistics}</value>
</data>
<data name="Available_Thrown_Exception" xml:space="preserve">
<value>FreeSql: {name}: An exception needs to be thrown</value>
</data>
<data name="Bad_Expression_Format" xml:space="preserve">
<value>FreeSql: Wrong expression format {column}</value>
</data>
<data name="Before_Chunk_Cannot_Use_Select" xml:space="preserve">
<value>FreeSql: Select is not available until the Chunk function</value>
</data>
<data name="Begin_Transaction_Then_ForUpdate" xml:space="preserve">
<value>FreeSql: For security reasons, be sure to use ForUpdate after the transaction is open</value>
</data>
<data name="Cannot_Be_NULL" xml:space="preserve">
<value>FreeSql: Cannot be null</value>
</data>
<data name="Cannot_Be_NULL_Name" xml:space="preserve">
<value>FreeSql: {name} cannot be null</value>
</data>
<data name="Cannot_Match_Property" xml:space="preserve">
<value>FreeSql: Unable to match {property}</value>
</data>
<data name="Cannot_Resolve_ExpressionTree" xml:space="preserve">
<value>FreeSql: {property} cannot be resolved to an expression tree</value>
</data>
<data name="Check_UseConnectionString" xml:space="preserve">
<value>FreeSql: The parameter master ConnectionString cannot be empty, check UseConnectionString</value>
</data>
<data name="Commit" xml:space="preserve">
<value>FreeSql: Commit</value>
</data>
<data name="Connection_Failed_Switch_Servers" xml:space="preserve">
<value>FreeSql: Connection failed, ready to switch other available servers</value>
</data>
<data name="Custom_Expression_ParsingError" xml:space="preserve">
<value>FreeSql: Custom expression parsing error: type {exp3MethodDeclaringType} needs to define static ThreadLocal&lt;ExpressionCallContext&gt;field, field, field (important three reminders)</value>
</data>
<data name="Custom_Reflection_IsNotNull" xml:space="preserve">
<value>FreeSql: Custom {Reflection Information} cannot be empty, format: {static method name}{space}{reflection information}</value>
</data>
<data name="Custom_StaticMethodName_IsNotNull" xml:space="preserve">
<value>FreeSql: Custom {static method name} cannot be empty, format: {static method name}{space}{reflection information}</value>
</data>
<data name="Custom_StaticMethodName_NotSet_DynamicFilterCustom" xml:space="preserve">
<value>FreeSql: Custom corresponding {{static method name}}:{fiValueCustomArray} The [DynamicFilterCustomAttribute] attribute is not set</value>
</data>
<data name="CustomFieldSeparatedBySpaces" xml:space="preserve">
<value>FreeSql: Custom requires that Fields be space-split and 2-length in the format: {static method name}{space}{reflection information}</value>
</data>
<data name="DataType_AsType_Inconsistent" xml:space="preserve">
<value>FreeSql: The data type of the operation ({dataDisplayCsharp}) is inconsistent with AsType ({tableTypeDisplayCsharp}). Please check.</value>
</data>
<data name="DateRange_Comma_Separateda_By2Char" xml:space="preserve">
<value>FreeSql: DateRange requires that Value be comma-separated and 2-length</value>
</data>
<data name="DateRange_DateFormat_yyyy" xml:space="preserve">
<value>FreeSql: DateRange requires that the Value [1] format must be: yyyy, yyyy-MM, yyyy-MM-dd, yyyyy-MM-dd HH, yyyy, yyyy-MM-dd HH:mm</value>
</data>
<data name="DbUpdateVersionException_RowLevelOptimisticLock" xml:space="preserve">
<value>FreeSql: The record may not exist, or the row level optimistic lock version is out of date, the number of updates {sourceCount}, the number of rows affected {affrows}.</value>
</data>
<data name="Different_Number_SlaveConnectionString_SlaveWeights" xml:space="preserve">
<value>FreeSql: The number of SlaveConnectionStrings is not the same as SlaveWeights</value>
</data>
<data name="Duplicate_ColumnAttribute" xml:space="preserve">
<value>FreeSql: ColumnAttribute. Name {colattrName} exists repeatedly, please check (note: case insensitive)</value>
</data>
<data name="Duplicate_PropertyName" xml:space="preserve">
<value>FreeSql: Property name {pName} exists repeatedly, please check (note: case insensitive)</value>
</data>
<data name="Entity_Must_Primary_Key" xml:space="preserve">
<value>FreeSql: The {function} feature requires that the entity class {tableCsName} must have a primary key</value>
</data>
<data name="Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeys" xml:space="preserve">
<value>FreeSql: {tbTypeFullName} is a parent-child relationship, but combinations of multiple primary keys are not supported in versions below MySql 8.0</value>
</data>
<data name="Entity_NotParentChild_Relationship" xml:space="preserve">
<value>FreeSql: {tbTypeFullName} is not a parent-child relationship and cannot be used</value>
</data>
<data name="EspeciallySubquery_Cannot_Parsing" xml:space="preserve">
<value>FreeSql: This particular subquery cannot be resolved</value>
</data>
<data name="Expression_Error_Use_ParameterExpression" xml:space="preserve">
<value>FreeSql: Expression error, its top object is not ParameterExpression:{exp}</value>
</data>
<data name="Expression_Error_Use_Successive_MemberAccess_Type" xml:space="preserve">
<value>FreeSql: Expression error, it is not a continuous MemberAccess type: {exp}</value>
</data>
<data name="ExpressionTree_Convert_Type_Error" xml:space="preserve">
<value>FreeSql: ExpressionTree conversion type error, value ({value}), type ({valueTypeFullName}), target type ({typeFullName}), Error:{exMessage}</value>
</data>
<data name="Failed_SubTable_FieldValue" xml:space="preserve">
<value>FreeSql: Failed to parse table field value {sqlWhere}</value>
</data>
<data name="Functions_AsTable_NotImplemented" xml:space="preserve">
<value>FreeSql: Function {asTable} not implemented by AsTable</value>
</data>
<data name="GBase_NotSupport_OtherThanCommas" xml:space="preserve">
<value>FreeSql: GBase does not support separators other than commas at this time</value>
</data>
<data name="Generated_Same_SubTable" xml:space="preserve">
<value>FreeSql: TableName:{tableName} generated the same table name</value>
</data>
<data name="GetPrimarys_ParameterError_IsNotDictKey " xml:space="preserve">
<value>FreeSql: The parameter'{primary}'passed by GetPrimarys is incorrect and does not belong to the key name of the dictionary data</value>
</data>
<data name="Has_Specified_Cannot_Specified_Second" xml:space="preserve">
<value>FreeSql: {first} has already been specified and {second} can no longer be specified</value>
</data>
<data name="Ignored_Check_Confirm_PublicGetSet" xml:space="preserve">
<value>FreeSql: {tb2DbName}. {mp2MemberName} is ignored. Check the IsIgnore setting to make sure get/set is public</value>
</data>
<data name="Include_ParameterType_Error" xml:space="preserve">
<value>FreeSql: Include parameter type error</value>
</data>
<data name="Include_ParameterType_Error_Use_IncludeMany" xml:space="preserve">
<value>FreeSql: Include parameter type is wrong, use IncludeMany for collection properties</value>
</data>
<data name="Include_ParameterType_Error_Use_MemberAccess" xml:space="preserve">
<value>FreeSql: Include parameter type is wrong, expression type should be MemberAccess</value>
</data>
<data name="IncludeMany_NotValid_Navigation" xml:space="preserve">
<value>FreeSql: The property {collMemMemberName} of IncludeMany type {tbTypeDisplayCsharp} is not a valid navigation property, hint: IsIgnore = true will not be a navigation property</value>
</data>
<data name="IncludeMany_ParameterError_OnlyUseOneParameter" xml:space="preserve">
<value>FreeSql: IncludeMany {navigateSelector} parameter is wrong, Select can only use one parameter's method, the correct format:.Select(t =&gt;new TNavigate{{}})</value>
</data>
<data name="IncludeMany_ParameterError_Select_ReturnConsistentType" xml:space="preserve">
<value>FreeSql: IncludeMany {navigateSelector} parameter error, Select lambda parameter return value must match {collMemElementType} type</value>
</data>
<data name="IncludeMany_ParameterType_Error_Use_MemberAccess" xml:space="preserve">
<value>FreeSql: IncludeMany parameter 1 has wrong type, expression type should be MemberAccess</value>
</data>
<data name="IncludeMany_ParameterTypeError" xml:space="preserve">
<value>FreeSql: IncludeMany {navigateSelector} parameter type is wrong, correct format: a.collections.Take(1).Where(c =&gt; C.A ID == a.id).Select (a =&gt; new TNavigate{{}})</value>
</data>
<data name="InsertInto_No_Property_Selected" xml:space="preserve">
<value>FreeSql: ISelect. InsertInto() did not select an attribute: {displayCsharp}</value>
</data>
<data name="InsertInto_TypeError" xml:space="preserve">
<value>FreeSql: ISelect. InsertInto() type error: {displayCsharp}</value>
</data>
<data name="InsertOrUpdate_Must_Primary_Key" xml:space="preserve">
<value>FreeSql: The InsertOrUpdate function performs merge into requiring the entity class {CsName} to have a primary key</value>
</data>
<data name="InsertOrUpdate_NotSuport_Generic_UseEntity" xml:space="preserve">
<value>FreeSql: The generic parameter for InsertOrUpdate&lt;&gt;does not support {typeofT1}. Pass in your entity class</value>
</data>
<data name="Install_FreeSql_Extensions_LazyLoading" xml:space="preserve">
<value>FreeSql: FreeSql needs to be installed for Delayed Loading. Extensions. LazyLoading. Dll, downloadable to nuget</value>
</data>
<data name="LazyLoading_CompilationError" xml:space="preserve">
<value>FreeSql: {trytbTypeName} Compilation error: {exMessage}\r\n\r\n{cscode}</value>
</data>
<data name="LazyLoading_EntityMustDeclarePublic" xml:space="preserve">
<value>FreeSql: Entity type {trytbTypeName} must be declared public</value>
</data>
<data name="ManyToMany_AsSelect_NotSupport_Sum_Avg_etc" xml:space="preserve">
<value>FreeSql: ManyToMany navigation properties. AsSelect() is temporarily unavailable for the Sum/Avg/Max/Min/First/ToOne/ToList method</value>
</data>
<data name="ManyToMany_NotFound_CorrespondingField" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} did not find a corresponding field in {tbmidCsName}, such as: {midTypePropsTrytbName}{findtrytbPkCsName}, {midTypePropsTrytbName}_ {findtrytbPkCsName}</value>
</data>
<data name="ManyToMany_ParsingError_EntityMissing_PrimaryKey" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} parsing error, entity type {tbrefTypeName} missing primary key identity, [Column (IsPrimary = true)]</value>
</data>
<data name="ManyToMany_ParsingError_EntityMustHas_NavigateCollection" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} parsing error, entity type {tbrefTypeName} must have a corresponding [Navigate (ManyToMany = x)] collection property</value>
</data>
<data name="ManyToMany_ParsingError_InconsistentType" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} parsing error, {tbmidCsName}. {trycolCsName} and {trytbCsName}. {trytbPrimarysCsName} type inconsistent</value>
</data>
<data name="ManyToMany_ParsingError_IntermediateClass_ErrorMessage" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} parsing error, intermediate class {tbmidCsName}.{midTypePropsTrytbName} Error: {exMessage}</value>
</data>
<data name="ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne" xml:space="preserve">
<value>FreeSql: [ManyToMany] Navigation property {trytbTypeName}. {pnvName} parsing error, intermediate class {tbmidCsName}. The {midTypePropsTrytbName} navigation property is not ManyToOne or OneToOne</value>
</data>
<data name="Mapping_Exception_HasNo_SamePropertyName" xml:space="preserve">
<value>FreeSql: Mapping exception: {name} None of the property names are the same</value>
</data>
<data name="MasterPool_IsNull_UseTransaction" xml:space="preserve">
<value>FreeSql: Ado. MasterPool value is null, this operation cannot self-enable transactions, please explicitly pass [transaction object] resolution</value>
</data>
<data name="Missing_FreeSqlProvider_Package" xml:space="preserve">
<value>FreeSql: Missing FreeSql database implementation package: FreeSql.Provider.{Provider}.Dll, downloadable to nuget</value>
</data>
<data name="Missing_FreeSqlProvider_Package_Reason" xml:space="preserve">
<value>FreeSql: The FreeSql database implementation package is missing: {dll} can be downloaded to nuget; If there is {dll} and an error still occurs (due to environmental issues that cause the type to be unreflected), manually pass in typeof ({providerType}) in the third parameter of UseConnectionString/UseConnectionFactory</value>
</data>
<data name="Navigation_Bind_Number_Different" xml:space="preserve">
<value>FreeSql: Navigation property {trytbTypeName}. The number of {pnvName} attributes [Navigate] Binds ({bindColumnsCount}) is different from the number of external primary keys ({tbrefPrimarysLength})</value>
</data>
<data name="Navigation_Missing_AsSelect" xml:space="preserve">
<value>FreeSql: {tb2DbName}. {mp2MemberName} Navigation Property Collection forgotten. AsSelect()? If used in ToList (a =&gt; a. {mp2MemberName}), step by step to refer to the IncludeMany document.</value>
</data>
<data name="Navigation_Missing_SetProperty" xml:space="preserve">
<value>FreeSql: Navigation Properties {trytbTypeDisplayCsharp}. Missing set attribute for {pName}</value>
</data>
<data name="Navigation_NotFound_CorrespondingField" xml:space="preserve">
<value>FreeSql: Navigation property {trytbTypeName}. {pnvName} No corresponding fields were found, such as: {pnvName}{findtbrefPkCsName}, {pnvName}_ {findtbrefPkCsName}. Or use the [Navigate] attribute to specify the relationship mapping.</value>
</data>
<data name="Navigation_ParsingError_EntityMissingPrimaryKey" xml:space="preserve">
<value>FreeSql: Navigation property {trytbTypeName}. {pnvName} parsing error, entity type {trytcTypeName} missing primary key identity, [Column (IsPrimary = true)]</value>
</data>
<data name="Navigation_ParsingError_InconsistentType" xml:space="preserve">
<value>FreeSql: Navigation property {trytbTypeName}. {pnvName} parsing error, {trytbCsName}. {trycolCsName} and {tbrefCsName}. {tbrefPrimarysCsName} type inconsistent</value>
</data>
<data name="Navigation_ParsingError_NotFound_Property" xml:space="preserve">
<value>FreeSql: Navigation property {trytbTypeName}. {pnvName} attribute [Navigate] parsing error, property not found at {tbrefTypeName}: {bi}</value>
</data>
<data name="NoPrimaryKey_UseSetDto" xml:space="preserve">
<value>FreeSql: {tableTypeDisplayCsharp} has no primary key defined and cannot use SetSource. Try SetDto</value>
</data>
<data name="NoProperty_Defined" xml:space="preserve">
<value>FreeSql: No properties defined</value>
</data>
<data name="Not_Implemented" xml:space="preserve">
<value>FreeSql: Not implemented</value>
</data>
<data name="Not_Implemented_Expression" xml:space="preserve">
<value>FreeSql: Function expression {exp} parsing not implemented</value>
</data>
<data name="Not_Implemented_Expression_ParameterUseConstant" xml:space="preserve">
<value>FreeSql: Function expression {exp} parsing not implemented, parameter {expArguments} must be constant</value>
</data>
<data name="Not_Implemented_Expression_UseAsSelect" xml:space="preserve">
<value>FreeSql: Function expression {exp} parsing is not implemented. Use if you are working on a navigation property collection. AsSelect (). {exp3MethodName} ({exp3ArgumentsCount})</value>
</data>
<data name="Not_Implemented_MemberAcess_Constant" xml:space="preserve">
<value>FreeSql: Constant under MemberAccess is not implemented</value>
</data>
<data name="Not_Implemented_Name" xml:space="preserve">
<value>FreeSql: {name} is not implemented</value>
</data>
<data name="Not_Support" xml:space="preserve">
<value>FreeSql: I won't support it</value>
</data>
<data name="Not_Support_OrderByRandom" xml:space="preserve">
<value>FreeSql: {dataType} does not support OrderByRandom sorting</value>
</data>
<data name="Not_Valid_Navigation_Property" xml:space="preserve">
<value>FreeSql: {property} is not a valid navigation property</value>
</data>
<data name="NotFound_Column" xml:space="preserve">
<value>FreeSql: {dbName} Column {memberName} not found</value>
</data>
<data name="NotFound_CsName_Column" xml:space="preserve">
<value>FreeSql: Cannot find the column corresponding to {CsName}</value>
</data>
<data name="NotFound_Property" xml:space="preserve">
<value>FreeSql: Attribute not found: {memberName}</value>
</data>
<data name="NotFound_PropertyName" xml:space="preserve">
<value>FreeSql: Property name {proto} not found</value>
</data>
<data name="NotFound_Reflection" xml:space="preserve">
<value>FreeSql: Custom could not find the corresponding {{reflection information}}:{fiValueCustomArray}</value>
</data>
<data name="NotFound_Static_MethodName" xml:space="preserve">
<value>FreeSql: Custom could not find the corresponding {{static method name}}:{fiValueCustomArray}</value>
</data>
<data name="NotFound_Table_Property_AsTable" xml:space="preserve">
<value>FreeSql: The property name {atmGroupsValue} set by [Table(AsTable = xx)] does not exist</value>
</data>
<data name="NotSpecified_UseConnectionString_UseConnectionFactory" xml:space="preserve">
<value>FreeSql: No UseConnectionString or UseConnectionFactory specified</value>
</data>
<data name="ObjectPool_Get_Timeout" xml:space="preserve">
<value>FreeSql: [{policyName}] ObjectPool. {GetName}() timeout {totalSeconds} seconds, see: https://github.com/dotnetcore/FreeSql/discussions/1081</value>
</data>
<data name="ObjectPool_GetAsync_Queue_Long" xml:space="preserve">
<value>FreeSql: [{policyName}] ObjectPool. GetAsync() The queue is too long. Policy. AsyncGetCapacity = {asyncGetCapacity}</value>
</data>
<data name="OneToMany_NotFound_CorrespondingField" xml:space="preserve">
<value>FreeSql: [OneToMany] Navigation property {trytbTypeName}.{pnvName} did not find a corresponding field in {tbrefCsName}, such as: {findtrytb}{findtrytbPkCsName}, {findtrytb}_{findtrytbPkCsName}</value>
</data>
<data name="OneToMany_ParsingError_InconsistentType" xml:space="preserve">
<value>FreeSql: [OneToMany] Navigation property {trytbTypeName}.{pnvName} parsing error, {trytbCsName}.{trytbPrimarysCsName} and {tbrefCsName}.{trycolCsName} is of inconsistent type</value>
</data>
<data name="OneToMany_UseNavigate" xml:space="preserve">
<value>, {refpropName}{findtrytbPkCsName}, {refpropName}_{findtrytbPkCsName}. Or use the [Navigate] attribute to specify the relationship mapping.</value>
</data>
<data name="Parameter_Field_NotSpecified" xml:space="preserve">
<value>FreeSql: Parameter field not specified</value>
</data>
<data name="ParameterError_NotValid_Collection" xml:space="preserve">
<value>FreeSql: The {property} parameter is incorrect, it is not a collection property and must be IList&lt;T&gt;or ICollection&lt;T&gt;</value>
</data>
<data name="ParameterError_NotValid_Navigation" xml:space="preserve">
<value>FreeSql: The {property} parameter is incorrect, it is not a valid navigation property</value>
</data>
<data name="ParameterError_NotValid_PropertyName" xml:space="preserve">
<value>FreeSql: {where} parameter error, {keyval} is not a valid property name and cannot be found in entity class {reftbTypeDisplayCsharp}</value>
</data>
<data name="ParameterError_NotValid_UseCommas" xml:space="preserve">
<value>FreeSql: {property} parameter error, format "TopicId=Id, multiple groups using comma connection"</value>
</data>
<data name="Parsing_Failed" xml:space="preserve">
<value>FreeSql: Parsing failed {callExpMethodName} {message}</value>
</data>
<data name="Policy_ObjectPool_Dispose" xml:space="preserve">
<value>FreeSql: [{policyName}] The ObjectPool has been disposed, see: https://github.com/dotnetcore/FreeSql/discussions/1079</value>
</data>
<data name="Policy_Status_NotAvailable" xml:space="preserve">
<value>FreeSql: The {policyName} status is unavailable and cannot be used until the background checker is restored. {UnavailableExceptionMessage}</value>
</data>
<data name="Properties_AsRowLock_Must_Numeric_Byte" xml:space="preserve">
<value>FreeSql: The property {trytbVersionColumnCsName} is labeled as a row lock (optimistic lock) (IsVersion), but it must be a numeric type or byte[] or string, and it cannot be Nullable</value>
</data>
<data name="Properties_Cannot_Null" xml:space="preserve">
<value>FreeSql: Properrties parameter cannot be empty</value>
</data>
<data name="Property_Cannot_Find" xml:space="preserve">
<value>FreeSql: {property} property name not found</value>
</data>
<data name="Range_Comma_Separateda_By2Char" xml:space="preserve">
<value>FreeSql: Range requires that Value be comma-separated and 2-length</value>
</data>
<data name="RollBack" xml:space="preserve">
<value>FreeSql: RollBack</value>
</data>
<data name="RunTimeError_Reflection_IncludeMany" xml:space="preserve">
<value>FreeSql: Runtime error, reflection failed to get IncludeMany method</value>
</data>
<data name="Set_Column_IsNullable_False" xml:space="preserve">
<value>FreeSql: {qoteSql} is NULL unless the attribute [Column (IsNullable = false)]</value>
</data>
<data name="SubTableFieldValue_CannotLessThen" xml:space="preserve">
<value>FreeSql: Subtable field value'{dt}'cannot be less than'{beginTime}'</value>
</data>
<data name="SubTableFieldValue_IsNotNull" xml:space="preserve">
<value>FreeSql: Subtable field value cannot be null</value>
</data>
<data name="SubTableFieldValue_NotConvertDateTime" xml:space="preserve">
<value>FreeSql: The tabular field value'{columnValue}'cannot be converted to DateTime</value>
</data>
<data name="SubTableFieldValue_NotMatchTable" xml:space="preserve">
<value>FreeSql: Table field value'{dt}'does not match table name</value>
</data>
<data name="T2_Type_Error" xml:space="preserve">
<value>FreeSql: Type T2 Error</value>
</data>
<data name="TableName_Format_Error" xml:space="preserve">
<value>FreeSql: TableName format error, example: "log_{yyyyMMdd}"</value>
</data>
<data name="Type_AsType_Parameter_Error" xml:space="preserve">
<value>FreeSql: {Type}. AsType parameter error, please pass in the correct entity type</value>
</data>
<data name="Type_Cannot_Access_Constructor" xml:space="preserve">
<value>FreeSql: The {thatFullName} type cannot access the constructor</value>
</data>
<data name="Type_Error_Name" xml:space="preserve">
<value>FreeSql: {name} type error</value>
</data>
<data name="TypeAsType_NotSupport_Object" xml:space="preserve">
<value>FreeSql: {Type}. AsType parameter does not support specifying as object</value>
</data>
<data name="TypeError_CannotUse_IncludeMany" xml:space="preserve">
<value>FreeSql: Type {typeofFullName} error, IncludeMany cannot be used</value>
</data>
<data name="Unable_Parse_Expression" xml:space="preserve">
<value>FreeSql: Unable to parse expression: {exp}</value>
</data>
<data name="Unable_Parse_ExpressionMethod" xml:space="preserve">
<value>FreeSql: Unable to parse expression method {exp3tmpCallMethodName}</value>
</data>
<data name="Use_InsertDict_Method" xml:space="preserve">
<value>FreeSql: Please use fsql. InsertDict (dict) method inserts dictionary data</value>
</data>
<data name="S_NotFound_Name" xml:space="preserve">
<value>FreeSql: {name} not found</value>
</data>
<data name="S_SlaveDatabase" xml:space="preserve">
<value>FreeSql: Slave Database</value>
</data>
<data name="S_MasterDatabase" xml:space="preserve">
<value>FreeSql: Master Database</value>
</data>
<data name="S_Access_InsertOnlyOneAtTime" xml:space="preserve">
<value>FreeSql: Egg pain Accs insertion can only be performed one at a time, values (..) are not supported. (..) Select is also not supported.. UNION ALL select..</value>
</data>
<data name="S_BaseEntity_Initialization_Error" xml:space="preserve">
<value>FreeSql: BaseEntity. Initialization initialization error, get IFreeSql is null</value>
</data>
<data name="S_BlockAccess_WaitForRecovery" xml:space="preserve">
<value>FreeSql: [{thisName}] Block access and wait for recovery: {exMessage}</value>
</data>
<data name="S_CannotBeConverted_To_ISelect" xml:space="preserve">
<value>FreeSql: IQueryable&lt;{typeofName}&gt; cannot be converted to ISelect&lt;{typeofName}&gt; because its implementation is not FreeSql.Extensions.Linq.QueryableProvider</value>
</data>
<data name="S_ConnectionStringError" xml:space="preserve">
<value>FreeSql: Connection string error</value>
</data>
<data name="S_ConnectionStringError_Check" xml:space="preserve">
<value>FreeSql: [{thisName}] Connection string error, please check.</value>
</data>
<data name="S_ConnectionStringError_CheckProject" xml:space="preserve">
<value>FreeSql: Connection string error, or check project properties &gt; Build &gt; Target Platform: x86 | x64, Or use FreeSql.Provider.SqliteCore accessing arm platform</value>
</data>
<data name="S_ConnectionStringError_CheckProjectConnection" xml:space="preserve">
<value>FreeSql: [{thisName}] Connection string error, please check. Or check Project Properties &gt; Build &gt; Target Platform: x86 | x64, Or use FreeSql.Provider.SqliteCore accessing arm platform</value>
</data>
<data name="S_CustomAdapter_Cannot_Use_CreateCommand" xml:space="preserve">
<value>FreeSql: FreeSql.Provider.CustomAdapter cannot use CreateCommand</value>
</data>
<data name="S_CustomAdapter_OnlySuppport_UseConnectionFactory " xml:space="preserve">
<value>FreeSql: FreeSql.Provider.CustomAdapter only supports building IFreeSql in the UseConnectionFactory way</value>
</data>
<data name="S_Dameng_NotSupport_TablespaceSchemas " xml:space="preserve">
<value>FreeSql: Dream CodeFirst does not support code creation tablespace and schemas {tbname}</value>
</data>
<data name="S_DB_Parameter_Error_NoConnectionString" xml:space="preserve">
<value>FreeSql: -DB parameter error, no ConnectionString provided</value>
</data>
<data name="S_DB_ParameterError" xml:space="preserve">
<value>FreeSql: -DB parameter error, format: MySql, ConnectionString</value>
</data>
<data name="S_DB_ParameterError_UnsupportedType" xml:space="preserve">
<value>FreeSql: -DB parameter error, unsupported type: "{dbargs}"</value>
</data>
<data name="S_Features_Unique" xml:space="preserve">
<value>FreeSql: {method} is FreeSql.Provider.{provider} specific features</value>
</data>
<data name="S_InsertOrUpdate_Unable_UpdateColumns" xml:space="preserve">
<value>FreeSql: InsertOrUpdate Sqlite was unable to complete the UpdateColumns operation</value>
</data>
<data name="S_MygisGeometry_NotImplement" xml:space="preserve">
<value>FreeSql: MygisGeometry. Parse does not implement "{wkt}"</value>
</data>
<data name="S_NameOptions_Incorrect" xml:space="preserve">
<value>FreeSql: -NameOptions parameter incorrect, format: 0,0,0,0</value>
</data>
<data name="S_Not_Implemented_Feature" xml:space="preserve">
<value>FreeSql: This function is not implemented</value>
</data>
<data name="S_Not_Implemented_FeedBack" xml:space="preserve">
<value>FreeSql: Unrealized error, please feedback to author</value>
</data>
<data name="S_NotImplementSkipOffset" xml:space="preserve">
<value>FreeSql: FreeSql.Provider.{providerName} does not implement Skip/Offset functionality, use to determine last ID if paging is required</value>
</data>
<data name="S_OldTableExists" xml:space="preserve">
<value>FreeSql: Old table (OldName): {tboldname} exists, database already exists {tbname} table, cannot rename</value>
</data>
<data name="S_OnConflictDoUpdate_MustIsPrimary" xml:space="preserve">
<value>FreeSql: The OnConflictDoUpdate feature requires that entity classes must set the IsPrimary property</value>
</data>
<data name="S_Oracle_NotSupport_TablespaceSchemas" xml:space="preserve">
<value>FreeSql: Oracle CodeFirst does not support code creation of tablespace and schemas {tbname}</value>
</data>
<data name="S_ParsingFailed_UseRestoreToSelect" xml:space="preserve">
<value>FreeSql: Parsing failed {callExpMethodName} {message}, hint: Extension method IQueryable can be used. RestoreToSelect() reverted to ISelect re-query</value>
</data>
<data name="S_RequiresEntityPrimaryKey" xml:space="preserve">
<value>FreeSql: InsertOrUpdate + IfExistsDoNothing + {providerName} requires the entity class {tableCsName} to have a primary key</value>
</data>
<data name="S_SelectManayErrorType" xml:space="preserve">
<value>FreeSql: SelectMany error type: {typeFullName}</value>
</data>
<data name="S_Type_IsNot_Migrable" xml:space="preserve">
<value>FreeSql: Type {objentityTypeFullName} is not migrable</value>
</data>
<data name="S_Type_IsNot_Migrable_0Attributes" xml:space="preserve">
<value>FreeSql: Type {objentityTypeFullName} is not migrable, migratable property 0</value>
</data>
<data name="S_TypeMappingNotImplemented" xml:space="preserve">
<value>FreeSql: {columnDbTypeTextFull} type mapping not implemented</value>
</data>
<data name="S_WrongParameter" xml:space="preserve">
<value>FreeSql: Wrong parameter setting: {args}</value>
</data>
<data name="S_ObjectPool" xml:space="preserve">
<value>FreeSql: Object pool</value>
</data>
</root>

View File

@@ -1,638 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AsTable_PropertyName_FormatError" xml:space="preserve">
<value>[Table(AsTable = "{asTable}")] 特性值格式错误</value>
</data>
<data name="AsTable_PropertyName_NotDateTime" xml:space="preserve">
<value>[Table(AsTable = xx)] 设置的属性名 {atmGroupsValue} 不是 DateTime 类型</value>
</data>
<data name="Available_Failed_Get_Resource" xml:space="preserve">
<value>{name}: Failed to get resource {statistics}</value>
</data>
<data name="Available_Thrown_Exception" xml:space="preserve">
<value>{name}: An exception needs to be thrown</value>
</data>
<data name="Bad_Expression_Format" xml:space="preserve">
<value>错误的表达式格式 {column}</value>
</data>
<data name="Before_Chunk_Cannot_Use_Select" xml:space="preserve">
<value>Chunk 功能之前不可使用 Select</value>
</data>
<data name="Begin_Transaction_Then_ForUpdate" xml:space="preserve">
<value>安全起见,请务必在事务开启之后,再使用 ForUpdate</value>
</data>
<data name="Cannot_Be_NULL" xml:space="preserve">
<value>不能为 null</value>
</data>
<data name="Cannot_Be_NULL_Name" xml:space="preserve">
<value>{name} 不能为 null</value>
</data>
<data name="Cannot_Match_Property" xml:space="preserve">
<value>无法匹配 {property}</value>
</data>
<data name="Cannot_Resolve_ExpressionTree" xml:space="preserve">
<value>{property} 无法解析为表达式树</value>
</data>
<data name="Check_UseConnectionString" xml:space="preserve">
<value>参数 masterConnectionString 不可为空,请检查 UseConnectionString</value>
</data>
<data name="Commit" xml:space="preserve">
<value>提交</value>
</data>
<data name="Connection_Failed_Switch_Servers" xml:space="preserve">
<value>连接失败,准备切换其他可用服务器</value>
</data>
<data name="Custom_Expression_ParsingError" xml:space="preserve">
<value>自定义表达式解析错误:类型 {exp3MethodDeclaringType} 需要定义 static ThreadLocal&lt;ExpressionCallContext&gt; 字段、字段、字段(重要三次提醒)</value>
</data>
<data name="Custom_Reflection_IsNotNull" xml:space="preserve">
<value>Custom { 反射信息 }不能为空,格式:{ 静态方法名 }{ 空格 }{ 反射信息 }</value>
</data>
<data name="Custom_StaticMethodName_IsNotNull" xml:space="preserve">
<value>Custom { 静态方法名 }不能为空,格式:{ 静态方法名 }{ 空格 }{ 反射信息 }</value>
</data>
<data name="Custom_StaticMethodName_NotSet_DynamicFilterCustom" xml:space="preserve">
<value>Custom 对应的{{ 静态方法名 }}{fiValueCustomArray} 未设置 [DynamicFilterCustomAttribute] 特性</value>
</data>
<data name="CustomFieldSeparatedBySpaces" xml:space="preserve">
<value>Custom 要求 Field 应该空格分割,并且长度为 2格式{ 静态方法名 }{ 空格 }{ 反射信息 }</value>
</data>
<data name="DataType_AsType_Inconsistent" xml:space="preserve">
<value>操作的数据类型({dataDisplayCsharp}) 与 AsType({tableTypeDisplayCsharp}) 不一致,请检查。</value>
</data>
<data name="DateRange_Comma_Separateda_By2Char" xml:space="preserve">
<value>DateRange 要求 Value 应该逗号分割,并且长度为 2</value>
</data>
<data name="DateRange_DateFormat_yyyy" xml:space="preserve">
<value>DateRange 要求 Value[1] 格式必须为yyyy、yyyy-MM、yyyy-MM-dd、yyyy-MM-dd HH、yyyy、yyyy-MM-dd HH:mm</value>
</data>
<data name="DbUpdateVersionException_RowLevelOptimisticLock" xml:space="preserve">
<value>记录可能不存在,或者【行级乐观锁】版本过旧,更新数量{sourceCount},影响的行数{affrows}。</value>
</data>
<data name="Different_Number_SlaveConnectionString_SlaveWeights" xml:space="preserve">
<value>SlaveConnectionString 数量与 SlaveWeights 不相同</value>
</data>
<data name="Duplicate_ColumnAttribute" xml:space="preserve">
<value>ColumnAttribute.Name {colattrName} 重复存在,请检查(注意:不区分大小写)</value>
</data>
<data name="Duplicate_PropertyName" xml:space="preserve">
<value>属性名 {pName} 重复存在,请检查(注意:不区分大小写)</value>
</data>
<data name="Entity_Must_Primary_Key" xml:space="preserve">
<value>{function} 功能要求实体类 {tableCsName} 必须有主键</value>
</data>
<data name="Entity_MySQL_VersionsBelow8_NotSupport_Multiple_PrimaryKeys" xml:space="preserve">
<value>{tbTypeFullName} 是父子关系,但是 MySql 8.0 以下版本中不支持组合多主键</value>
</data>
<data name="Entity_NotParentChild_Relationship" xml:space="preserve">
<value>{tbTypeFullName} 不是父子关系,无法使用该功能</value>
</data>
<data name="EspeciallySubquery_Cannot_Parsing" xml:space="preserve">
<value>这个特别的子查询不能解析</value>
</data>
<data name="Expression_Error_Use_ParameterExpression" xml:space="preserve">
<value>表达式错误,它的顶级对象不是 ParameterExpression{exp}</value>
</data>
<data name="Expression_Error_Use_Successive_MemberAccess_Type" xml:space="preserve">
<value>表达式错误,它不是连续的 MemberAccess 类型:{exp}</value>
</data>
<data name="ExpressionTree_Convert_Type_Error" xml:space="preserve">
<value>ExpressionTree 转换类型错误,值({value}),类型({valueTypeFullName}),目标类型({typeFullName}){exMessage}</value>
</data>
<data name="Failed_SubTable_FieldValue" xml:space="preserve">
<value>未能解析分表字段值 {sqlWhere}</value>
</data>
<data name="Functions_AsTable_NotImplemented" xml:space="preserve">
<value>AsTable 未实现的功能 {asTable}</value>
</data>
<data name="GBase_NotSupport_OtherThanCommas" xml:space="preserve">
<value>GBase 暂时不支持逗号以外的分割符</value>
</data>
<data name="Generated_Same_SubTable" xml:space="preserve">
<value>tableName{tableName} 生成了相同的分表名</value>
</data>
<data name="GetPrimarys_ParameterError_IsNotDictKey " xml:space="preserve">
<value>GetPrimarys 传递的参数 "{primary}" 不正确,它不属于字典数据的键名</value>
</data>
<data name="Has_Specified_Cannot_Specified_Second" xml:space="preserve">
<value>已经指定了 {first},不能再指定 {second}</value>
</data>
<data name="Ignored_Check_Confirm_PublicGetSet" xml:space="preserve">
<value>{tb2DbName}.{mp2MemberName} 被忽略,请检查 IsIgnore 设置,确认 get/set 为 public</value>
</data>
<data name="Include_ParameterType_Error" xml:space="preserve">
<value>Include 参数类型错误</value>
</data>
<data name="Include_ParameterType_Error_Use_IncludeMany" xml:space="preserve">
<value>Include 参数类型错误,集合属性请使用 IncludeMany</value>
</data>
<data name="Include_ParameterType_Error_Use_MemberAccess" xml:space="preserve">
<value>Include 参数类型错误,表达式类型应该为 MemberAccess</value>
</data>
<data name="IncludeMany_NotValid_Navigation" xml:space="preserve">
<value>IncludeMany 类型 {tbTypeDisplayCsharp} 的属性 {collMemMemberName} 不是有效的导航属性提示IsIgnore = true 不会成为导航属性</value>
</data>
<data name="IncludeMany_ParameterError_OnlyUseOneParameter" xml:space="preserve">
<value>IncludeMany {navigateSelector} 参数错误Select 只可以使用一个参数的方法,正确格式:.Select(t =&gt;new TNavigate {{}})</value>
</data>
<data name="IncludeMany_ParameterError_Select_ReturnConsistentType" xml:space="preserve">
<value>IncludeMany {navigateSelector} 参数错误Select lambda参数返回值必须和 {collMemElementType} 类型一致</value>
</data>
<data name="IncludeMany_ParameterType_Error_Use_MemberAccess" xml:space="preserve">
<value>IncludeMany 参数1 类型错误,表达式类型应该为 MemberAccess</value>
</data>
<data name="IncludeMany_ParameterTypeError" xml:space="preserve">
<value>IncludeMany {navigateSelector} 参数类型错误,正确格式: a.collections.Take(1).Where(c =&gt;c.aid == a.id).Select(a=&gt; new TNavigate{{}})</value>
</data>
<data name="InsertInto_No_Property_Selected" xml:space="preserve">
<value>ISelect.InsertInto() 未选择属性: {displayCsharp}</value>
</data>
<data name="InsertInto_TypeError" xml:space="preserve">
<value>ISelect.InsertInto() 类型错误: {displayCsharp}</value>
</data>
<data name="InsertOrUpdate_Must_Primary_Key" xml:space="preserve">
<value>InsertOrUpdate 功能执行 merge into 要求实体类 {CsName} 必须有主键</value>
</data>
<data name="InsertOrUpdate_NotSuport_Generic_UseEntity" xml:space="preserve">
<value>InsertOrUpdate&lt;&gt;的泛型参数 不支持 {typeofT1},请传递您的实体类</value>
</data>
<data name="Install_FreeSql_Extensions_LazyLoading" xml:space="preserve">
<value>【延时加载】功能需要安装 FreeSql.Extensions.LazyLoading.dll可前往 nuget 下载</value>
</data>
<data name="LazyLoading_CompilationError" xml:space="preserve">
<value>【延时加载】{trytbTypeName} 编译错误:{exMessage}\r\n\r\n{cscode}</value>
</data>
<data name="LazyLoading_EntityMustDeclarePublic" xml:space="preserve">
<value>【延时加载】实体类型 {trytbTypeName} 必须声明为 public</value>
</data>
<data name="ManyToMany_AsSelect_NotSupport_Sum_Avg_etc" xml:space="preserve">
<value>ManyToMany 导航属性 .AsSelect() 暂时不可用于 Sum/Avg/Max/Min/First/ToOne/ToList 方法</value>
</data>
<data name="ManyToMany_NotFound_CorrespondingField" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 在 {tbmidCsName} 中没有找到对应的字段,如:{midTypePropsTrytbName}{findtrytbPkCsName}、{midTypePropsTrytbName}_{findtrytbPkCsName}</value>
</data>
<data name="ManyToMany_ParsingError_EntityMissing_PrimaryKey" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,实体类型 {tbrefTypeName} 缺少主键标识,[Column(IsPrimary = true)]</value>
</data>
<data name="ManyToMany_ParsingError_EntityMustHas_NavigateCollection" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,实体类型 {tbrefTypeName} 必须存在对应的 [Navigate(ManyToMany = x)] 集合属性</value>
</data>
<data name="ManyToMany_ParsingError_InconsistentType" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,{tbmidCsName}.{trycolCsName} 和 {trytbCsName}.{trytbPrimarysCsName} 类型不一致</value>
</data>
<data name="ManyToMany_ParsingError_IntermediateClass_ErrorMessage" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,中间类 {tbmidCsName}.{midTypePropsTrytbName} 错误:{exMessage}</value>
</data>
<data name="ManyToMany_ParsingError_IntermediateClass_NotManyToOne_OneToOne" xml:space="preserve">
<value>【ManyToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,中间类 {tbmidCsName}.{midTypePropsTrytbName} 导航属性不是【ManyToOne】或【OneToOne】</value>
</data>
<data name="Mapping_Exception_HasNo_SamePropertyName" xml:space="preserve">
<value>映射异常:{name} 没有一个属性名相同</value>
</data>
<data name="MasterPool_IsNull_UseTransaction" xml:space="preserve">
<value>Ado.MasterPool 值为 null该操作无法自启用事务请显式传递【事务对象】解决</value>
</data>
<data name="Missing_FreeSqlProvider_Package" xml:space="preserve">
<value>缺少 FreeSql 数据库实现包FreeSql.Provider.{Provider}.dll可前往 nuget 下载</value>
</data>
<data name="Missing_FreeSqlProvider_Package_Reason" xml:space="preserve">
<value>缺少 FreeSql 数据库实现包:{dll},可前往 nuget 下载;如果存在 {dll} 依然报错(原因是环境问题导致反射不到类型),请在 UseConnectionString/UseConnectionFactory 第三个参数手工传入 typeof({providerType})</value>
</data>
<data name="Navigation_Bind_Number_Different" xml:space="preserve">
<value>导航属性 {trytbTypeName}.{pnvName} 特性 [Navigate] Bind 数目({bindColumnsCount}) 与 外部主键数目({tbrefPrimarysLength}) 不相同</value>
</data>
<data name="Navigation_Missing_AsSelect" xml:space="preserve">
<value>{tb2DbName}.{mp2MemberName} 导航属性集合忘了 .AsSelect() 吗?如果在 ToList(a =&gt; a.{mp2MemberName}) 中使用,请移步参考 IncludeMany 文档。</value>
</data>
<data name="Navigation_Missing_SetProperty" xml:space="preserve">
<value>【导航属性】{trytbTypeDisplayCsharp}.{pName} 缺少 set 属性</value>
</data>
<data name="Navigation_NotFound_CorrespondingField" xml:space="preserve">
<value>导航属性 {trytbTypeName}.{pnvName} 没有找到对应的字段,如:{pnvName}{findtbrefPkCsName}、{pnvName}_{findtbrefPkCsName}。或者使用 [Navigate] 特性指定关系映射。</value>
</data>
<data name="Navigation_ParsingError_EntityMissingPrimaryKey" xml:space="preserve">
<value>导航属性 {trytbTypeName}.{pnvName} 解析错误,实体类型 {trytcTypeName} 缺少主键标识,[Column(IsPrimary = true)]</value>
</data>
<data name="Navigation_ParsingError_InconsistentType" xml:space="preserve">
<value>导航属性 {trytbTypeName}.{pnvName} 解析错误,{trytbCsName}.{trycolCsName} 和 {tbrefCsName}.{tbrefPrimarysCsName} 类型不一致</value>
</data>
<data name="Navigation_ParsingError_NotFound_Property" xml:space="preserve">
<value>导航属性 {trytbTypeName}.{pnvName} 特性 [Navigate] 解析错误,在 {tbrefTypeName} 未找到属性:{bi}</value>
</data>
<data name="NoPrimaryKey_UseSetDto" xml:space="preserve">
<value>{tableTypeDisplayCsharp} 没有定义主键,无法使用 SetSource请尝试 SetDto 或者 SetSource 指定临时主键</value>
</data>
<data name="NoProperty_Defined" xml:space="preserve">
<value> 没有定义属性 </value>
</data>
<data name="Not_Implemented" xml:space="preserve">
<value>未实现</value>
</data>
<data name="Not_Implemented_Expression" xml:space="preserve">
<value>未实现函数表达式 {exp} 解析</value>
</data>
<data name="Not_Implemented_Expression_ParameterUseConstant" xml:space="preserve">
<value>未实现函数表达式 {exp} 解析,参数 {expArguments} 必须为常量</value>
</data>
<data name="Not_Implemented_Expression_UseAsSelect" xml:space="preserve">
<value>未实现函数表达式 {exp} 解析,如果正在操作导航属性集合,请使用 .AsSelect().{exp3MethodName}({exp3ArgumentsCount})</value>
</data>
<data name="Not_Implemented_MemberAcess_Constant" xml:space="preserve">
<value>未实现 MemberAccess 下的 Constant</value>
</data>
<data name="Not_Implemented_Name" xml:space="preserve">
<value>未实现 {name}</value>
</data>
<data name="Not_Support" xml:space="preserve">
<value>不支持</value>
</data>
<data name="Not_Support_OrderByRandom" xml:space="preserve">
<value>{dataType} 不支持 OrderByRandom 随机排序</value>
</data>
<data name="Not_Valid_Navigation_Property" xml:space="preserve">
<value>{property} 不是有效的导航属性</value>
</data>
<data name="NotFound_Column" xml:space="preserve">
<value>{dbName} 找不到列 {memberName}</value>
</data>
<data name="NotFound_CsName_Column" xml:space="preserve">
<value>找不到 {CsName} 对应的列</value>
</data>
<data name="NotFound_Property" xml:space="preserve">
<value>找不到属性:{memberName}</value>
</data>
<data name="NotFound_PropertyName" xml:space="preserve">
<value>找不到属性名 {proto}</value>
</data>
<data name="NotFound_Reflection" xml:space="preserve">
<value>Custom 找不到对应的{{ 反射信息 }}{fiValueCustomArray}</value>
</data>
<data name="NotFound_Static_MethodName" xml:space="preserve">
<value>Custom 找不到对应的{{ 静态方法名 }}{fiValueCustomArray}</value>
</data>
<data name="NotFound_Table_Property_AsTable" xml:space="preserve">
<value>[Table(AsTable = xx)] 设置的属性名 {atmGroupsValue} 不存在</value>
</data>
<data name="NotSpecified_UseConnectionString_UseConnectionFactory" xml:space="preserve">
<value>未指定 UseConnectionString 或者 UseConnectionFactory</value>
</data>
<data name="ObjectPool_Get_Timeout" xml:space="preserve">
<value>【{policyName}】ObjectPool.{GetName}() timeout {totalSeconds} seconds, see: https://github.com/dotnetcore/FreeSql/discussions/1081</value>
</data>
<data name="ObjectPool_GetAsync_Queue_Long" xml:space="preserve">
<value>【{policyName}】ObjectPool.GetAsync() The queue is too long. Policy.AsyncGetCapacity = {asyncGetCapacity}</value>
</data>
<data name="OneToMany_NotFound_CorrespondingField" xml:space="preserve">
<value>【OneToMany】导航属性 {trytbTypeName}.{pnvName} 在 {tbrefCsName} 中没有找到对应的字段,如:{findtrytb}{findtrytbPkCsName}、{findtrytb}_{findtrytbPkCsName}</value>
</data>
<data name="OneToMany_ParsingError_InconsistentType" xml:space="preserve">
<value>【OneToMany】导航属性 {trytbTypeName}.{pnvName} 解析错误,{trytbCsName}.{trytbPrimarysCsName} 和 {tbrefCsName}.{trycolCsName} 类型不一致</value>
</data>
<data name="OneToMany_UseNavigate" xml:space="preserve">
<value>、{refpropName}{findtrytbPkCsName}、{refpropName}_{findtrytbPkCsName}。或者使用 [Navigate] 特性指定关系映射。</value>
</data>
<data name="Parameter_Field_NotSpecified" xml:space="preserve">
<value>参数 field 未指定</value>
</data>
<data name="ParameterError_NotValid_Collection" xml:space="preserve">
<value>{property} 参数错误,它不是集合属性,必须为 IList&lt;T&gt; 或者 ICollection&lt;T&gt;</value>
</data>
<data name="ParameterError_NotValid_Navigation" xml:space="preserve">
<value>{property} 参数错误,它不是有效的导航属性</value>
</data>
<data name="ParameterError_NotValid_PropertyName" xml:space="preserve">
<value>{where} 参数错误,{keyval} 不是有效的属性名,在实体类 {reftbTypeDisplayCsharp} 无法找到</value>
</data>
<data name="ParameterError_NotValid_UseCommas" xml:space="preserve">
<value>{property} 参数错误,格式 "TopicId=Id多组使用逗号连接" </value>
</data>
<data name="Parsing_Failed" xml:space="preserve">
<value>解析失败 {callExpMethodName} {message}</value>
</data>
<data name="Policy_ObjectPool_Dispose" xml:space="preserve">
<value>【{policyName}】The ObjectPool has been disposed, see: https://github.com/dotnetcore/FreeSql/discussions/1079</value>
</data>
<data name="Policy_Status_NotAvailable" xml:space="preserve">
<value>【{policyName}】状态不可用,等待后台检查程序恢复方可使用。{UnavailableExceptionMessage}</value>
</data>
<data name="Properties_AsRowLock_Must_Numeric_Byte" xml:space="preserve">
<value>属性{trytbVersionColumnCsName} 被标注为行锁(乐观锁)(IsVersion),但其必须为数字类型 或者 byte[] 或者 string并且不可为 Nullable</value>
</data>
<data name="Properties_Cannot_Null" xml:space="preserve">
<value>properties 参数不能为空</value>
</data>
<data name="Property_Cannot_Find" xml:space="preserve">
<value>{property} 属性名无法找到</value>
</data>
<data name="Range_Comma_Separateda_By2Char" xml:space="preserve">
<value>Range 要求 Value 应该逗号分割,并且长度为 2</value>
</data>
<data name="RollBack" xml:space="preserve">
<value>回滚</value>
</data>
<data name="RunTimeError_Reflection_IncludeMany" xml:space="preserve">
<value>运行时错误,反射获取 IncludeMany 方法失败</value>
</data>
<data name="S_Access_InsertOnlyOneAtTime" xml:space="preserve">
<value>蛋疼的 Access 插入只能一条一条执行,不支持 values(..),(..) 也不支持 select .. UNION ALL select ..</value>
<comment>Providers</comment>
</data>
<data name="S_BaseEntity_Initialization_Error" xml:space="preserve">
<value>BaseEntity.Initialization 初始化错误,获取到 IFreeSql 是 null</value>
<comment>Extensions</comment>
</data>
<data name="S_BlockAccess_WaitForRecovery" xml:space="preserve">
<value>【{thisName}】Block access and wait for recovery: {exMessage}</value>
<comment>Providers</comment>
</data>
<data name="S_CannotBeConverted_To_ISelect" xml:space="preserve">
<value>无法将 IQueryable&lt;{typeofName}&gt; 转换为 ISelect&lt;{typeofName}&gt;,因为他的实现不是 FreeSql.Extensions.Linq.QueryableProvider</value>
<comment>Extensions</comment>
</data>
<data name="S_ConnectionStringError" xml:space="preserve">
<value>连接字符串错误</value>
<comment>Providers</comment>
</data>
<data name="S_ConnectionStringError_Check" xml:space="preserve">
<value>【{thisName}】连接字符串错误,请检查。</value>
<comment>Providers</comment>
</data>
<data name="S_ConnectionStringError_CheckProject" xml:space="preserve">
<value>连接字符串错误,或者检查项目属性 &gt; 生成 &gt; 目标平台x86 | x64或者改用 FreeSql.Provider.SqliteCore 访问 arm 平台</value>
<comment>Providers</comment>
</data>
<data name="S_ConnectionStringError_CheckProjectConnection" xml:space="preserve">
<value>【{thisName}】连接字符串错误,请检查。或者检查项目属性 &gt; 生成 &gt; 目标平台x86 | x64或者改用 FreeSql.Provider.SqliteCore 访问 arm 平台</value>
<comment>Providers</comment>
</data>
<data name="S_CustomAdapter_Cannot_Use_CreateCommand" xml:space="preserve">
<value>FreeSql.Provider.CustomAdapter 无法使用 CreateCommand</value>
<comment>Providers</comment>
</data>
<data name="S_CustomAdapter_OnlySuppport_UseConnectionFactory " xml:space="preserve">
<value>FreeSql.Provider.CustomAdapter 仅支持 UseConnectionFactory 方式构建 IFreeSql</value>
<comment>Providers</comment>
</data>
<data name="S_Dameng_NotSupport_TablespaceSchemas " xml:space="preserve">
<value>达梦 CodeFirst 不支持代码创建 tablespace 与 schemas {tbname}</value>
<comment>Providers</comment>
</data>
<data name="S_DB_Parameter_Error_NoConnectionString" xml:space="preserve">
<value>-DB 参数错误,未提供 ConnectionString</value>
<comment>Extensions</comment>
</data>
<data name="S_DB_ParameterError" xml:space="preserve">
<value>-DB 参数错误格式为MySql,ConnectionString</value>
<comment>Extensions</comment>
</data>
<data name="S_DB_ParameterError_UnsupportedType" xml:space="preserve">
<value>-DB 参数错误,不支持的类型:"{dbargs}"</value>
<comment>Extensions</comment>
</data>
<data name="S_Features_Unique" xml:space="preserve">
<value>{method} 是 FreeSql.Provider.{provider} 特有的功能</value>
<comment>Providers</comment>
</data>
<data name="S_InsertOrUpdate_Unable_UpdateColumns" xml:space="preserve">
<value>fsql.InsertOrUpdate Sqlite 无法完成 UpdateColumns 操作</value>
<comment>Providers</comment>
</data>
<data name="S_MasterDatabase" xml:space="preserve">
<value>主库</value>
<comment>Providers</comment>
</data>
<data name="S_MygisGeometry_NotImplement" xml:space="preserve">
<value>MygisGeometry.Parse 未实现 "{wkt}"</value>
<comment>Providers</comment>
</data>
<data name="S_NameOptions_Incorrect" xml:space="preserve">
<value>-NameOptions 参数错误格式为0,0,0,0</value>
<comment>Extensions</comment>
</data>
<data name="S_Not_Implemented_Feature" xml:space="preserve">
<value> 未实现该功能</value>
<comment>Providers</comment>
</data>
<data name="S_Not_Implemented_FeedBack" xml:space="preserve">
<value>未实现错误,请反馈给作者</value>
<comment>Providers</comment>
</data>
<data name="S_NotFound_Name" xml:space="preserve">
<value>找不到 {name}</value>
<comment>Providers</comment>
</data>
<data name="S_NotImplementSkipOffset" xml:space="preserve">
<value>FreeSql.Provider.{providerName} 未实现 Skip/Offset 功能,如果需要分页请使用判断上一次 id</value>
<comment>Providers</comment>
</data>
<data name="S_ObjectPool" xml:space="preserve">
<value>对象池</value>
<comment>Providers</comment>
</data>
<data name="S_OldTableExists" xml:space="preserve">
<value>旧表(OldName){tboldname} 存在,数据库已存在 {tbname} 表,无法改名</value>
<comment>Providers</comment>
</data>
<data name="S_OnConflictDoUpdate_MustIsPrimary" xml:space="preserve">
<value>OnConflictDoUpdate 功能要求实体类必须设置 IsPrimary 属性</value>
<comment>Providers</comment>
</data>
<data name="S_Oracle_NotSupport_TablespaceSchemas" xml:space="preserve">
<value>Oracle CodeFirst 不支持代码创建 tablespace 与 schemas {tbname}</value>
<comment>Providers</comment>
</data>
<data name="S_ParsingFailed_UseRestoreToSelect" xml:space="preserve">
<value>解析失败 {callExpMethodName} {message},提示:可以使用扩展方法 IQueryable.RestoreToSelect() 还原为 ISelect 再查询</value>
<comment>Extensions</comment>
</data>
<data name="S_RequiresEntityPrimaryKey" xml:space="preserve">
<value>fsql.InsertOrUpdate + IfExistsDoNothing + {providerName}要求实体类 {tableCsName} 必须有主键</value>
<comment>Providers</comment>
</data>
<data name="S_SelectManayErrorType" xml:space="preserve">
<value>SelectMany 错误的类型:{typeFullName}</value>
<comment>Extensions</comment>
</data>
<data name="S_SlaveDatabase" xml:space="preserve">
<value>从库</value>
<comment>Providers</comment>
</data>
<data name="S_Type_IsNot_Migrable" xml:space="preserve">
<value>类型 {objentityTypeFullName} 不可迁移</value>
<comment>Providers</comment>
</data>
<data name="S_Type_IsNot_Migrable_0Attributes" xml:space="preserve">
<value>类型 {objentityTypeFullName} 不可迁移可迁移属性0个</value>
<comment>Providers</comment>
</data>
<data name="S_TypeMappingNotImplemented" xml:space="preserve">
<value>未实现 {columnDbTypeTextFull} 类型映射</value>
<comment>Providers</comment>
</data>
<data name="S_WrongParameter" xml:space="preserve">
<value>错误的参数设置:{args}</value>
<comment>Extensions</comment>
</data>
<data name="Set_Column_IsNullable_False" xml:space="preserve">
<value>{qoteSql} is NULL除非设置特性 [Column(IsNullable = false)]</value>
</data>
<data name="SubTableFieldValue_CannotLessThen" xml:space="preserve">
<value>分表字段值 "{dt}" 不能小于 "{beginTime} "</value>
</data>
<data name="SubTableFieldValue_IsNotNull" xml:space="preserve">
<value>分表字段值不能为 null</value>
</data>
<data name="SubTableFieldValue_NotConvertDateTime" xml:space="preserve">
<value>分表字段值 "{columnValue}" 不能转化成 DateTime</value>
</data>
<data name="SubTableFieldValue_NotMatchTable" xml:space="preserve">
<value>分表字段值 "{dt}" 未匹配到分表名</value>
</data>
<data name="T2_Type_Error" xml:space="preserve">
<value>T2 类型错误</value>
</data>
<data name="TableName_Format_Error" xml:space="preserve">
<value>tableName 格式错误示例“log_{yyyyMMdd}”</value>
</data>
<data name="Type_AsType_Parameter_Error" xml:space="preserve">
<value>{Type}.AsType 参数错误,请传入正确的实体类型</value>
</data>
<data name="Type_Cannot_Access_Constructor" xml:space="preserve">
<value>{thatFullName} 类型无法访问构造函数</value>
</data>
<data name="Type_Error_Name" xml:space="preserve">
<value>{name} 类型错误</value>
</data>
<data name="TypeAsType_NotSupport_Object" xml:space="preserve">
<value>{Type}.AsType 参数不支持指定为 object</value>
</data>
<data name="TypeError_CannotUse_IncludeMany" xml:space="preserve">
<value>类型 {typeofFullName} 错误,不能使用 IncludeMany</value>
</data>
<data name="Unable_Parse_Expression" xml:space="preserve">
<value>无法解析表达式:{exp}</value>
</data>
<data name="Unable_Parse_ExpressionMethod" xml:space="preserve">
<value>无法解析表达式方法 {exp3tmpCallMethodName}</value>
</data>
<data name="Use_InsertDict_Method" xml:space="preserve">
<value>请使用 fsql.InsertDict(dict) 方法插入字典数据</value>
</data>
</root>

View File

@@ -1,281 +0,0 @@
<#@ template hostspecific="true" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="System.Windows.Forms" #>
<#@ import namespace="System.Collections" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.ComponentModel.Design" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Resources" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
<#
var model = LoadResources();
#>
// <auto-generated />
using System;
using System.Reflection;
using System.Resources;
using System.Globalization;
<#
if (!model.NoDiagnostics)
{
#>
using System.Threading;
<#
}
#>
namespace <#= model.Namespace #>
{
<#
if (model.Namespace.EndsWith("Internal")
|| model.AccessModifier == "internal")
{
#>
/// <summary>
/// This is an internal API that supports the FreeSql infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new FreeSql release.
/// </summary>
<#
}
else
{
#>
/// <summary>
/// <para>
/// String resources used in FreeSql exceptions, etc.
/// </para>
/// <para>
/// These strings are exposed publicly for use by database providers and extensions.
/// It is unusual for application code to need these strings.
/// </para>
/// </summary>
<#
}
#>
<#= model.AccessModifier #> static class <#= model.Class #>
{
private static readonly ResourceManager _resourceManager = new ResourceManager("<#= model.ResourceName #>", typeof(<#= model.Class #>).Assembly);
private static CultureInfo _resourceCulture;
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
public static CultureInfo Culture
{
get
{
return _resourceCulture;
}
set
{
_resourceCulture = value;
}
}
<#
foreach (var resource in model.Resources)
{
#>
/// <summary>
<#
foreach (var line in Lines(resource.Value))
{
#>
/// <#= Xml(line) #>
<#
}
#>
/// </summary>
<#
if (resource.Obsolete)
{
#>
[Obsolete]
<#
}
if (resource.Parameters.Any())
{
#>
public static string <#= resource.Name #>(<#= List("object ", resource.Parameters.Select(e => e.ParamString)) #>)
=> string.Format(
GetString("<#= resource.Name #>", <#= List(resource.Parameters.Select(e => e.NameOfString)) #>),
<#= List(resource.Parameters.Select(e => e.ParamString)) #>);
<#
}
else
{
#>
public static string <#= resource.Name #>
=> GetString("<#= resource.Name #>");
<#
}
}
#>
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name,_resourceCulture);
for (var i = 0; i < formatterNames.Length; i++)
{
value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}");
}
return value;
}
}
}
<#+
ResourceFile LoadResources()
{
var result = new ResourceFile();
if (Session.ContainsKey("AccessModifier"))
{
result.AccessModifier = (string)Session["AccessModifier"];
};
var services = (IServiceProvider)Host;
var dte = (DTE)services.GetCOMService(typeof(DTE));
if (!Session.TryGetValue("NoDiagnostics", out var noDiagnostics))
{
noDiagnostics = false;
}
result.NoDiagnostics = (bool)noDiagnostics;
var resourceFile = (string)Session["ResourceFile"];
if (!Path.IsPathRooted(resourceFile))
{
resourceFile = Host.ResolvePath(resourceFile);
}
var resourceProjectItem = dte.Solution.FindProjectItem(resourceFile);
var templateProjectItem = dte.Solution.FindProjectItem(Host.TemplateFile);
var project = templateProjectItem.ContainingProject;
var rootNamespace = (string)project.Properties.Item("RootNamespace").Value;
var resourceDir = Path.GetDirectoryName(resourceFile);
var projectDir = (string)project.Properties.Item("FullPath").Value;
var resourceNamespace = rootNamespace + "." + resourceDir.Substring(projectDir.Length)
.Replace(Path.DirectorySeparatorChar, '.');
result.Namespace = (string)resourceProjectItem.Properties.Item("CustomToolNamespace")?.Value;
if (string.IsNullOrEmpty(result.Namespace))
{
result.Namespace = resourceNamespace;
}
result.Class = Path.GetFileNameWithoutExtension(resourceFile);
result.ResourceName = resourceNamespace + "." + result.Class;
if(File.Exists(resourceFile.Replace(".resx", ".zh-Hans.resx")))
{
resourceFile = resourceFile.Replace(".resx", ".zh-Hans.resx");
}
List<ResXDataNode> sortedResources;
using (var reader = new ResXResourceReader(resourceFile))
{
reader.UseResXDataNodes = true;
sortedResources = Enumerable.ToList(
from DictionaryEntry r in reader
orderby r.Key
select (ResXDataNode)r.Value);
result.Resources = sortedResources
.Select(r => new Resource(r))
.ToList();
}
using (var writer = new ResXResourceWriter(resourceFile))
{
foreach (var node in sortedResources)
writer.AddResource(node);
writer.Generate();
}
return result;
}
IEnumerable<string> Lines(string value)
=> value.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
string Xml(string value)
=> value.Replace("<", "&lt;").Replace(">", "&gt;");
string List(IEnumerable<string> items)
=> List(null, items);
string List(string prefix, IEnumerable<string> items, string suffix = null)
=> string.Join(", ", items.Select(i => prefix + i + suffix));
class ResourceFile
{
public string Namespace { get; set; }
public string AccessModifier { get; set; } = "public";
public string Class { get; set; }
public string ResourceName { get; set; }
public IEnumerable<Resource> Resources { get; set; }
public bool NoDiagnostics { get; set; }
}
class Resource
{
public Resource(ResXDataNode node)
{
Name = node.Name;
Value = (string)node.GetValue((ITypeResolutionService)null);
var parameters = Regex.Matches(Value, @"\{(\w+)\}")
.Cast<Match>()
.Select(m => m.Groups[1].Value)
.Distinct()
.Select(n => ("nameof(" + n + ")", n))
.ToList();
foreach (var parameter in parameters.ToList())
{
var rawString = parameter.Item2;
var underscoreIndex = rawString.IndexOf('_');
if (underscoreIndex > 0)
{
var newIndex = int.Parse(rawString.Substring(0, underscoreIndex));
parameters[newIndex] = ("\"" + rawString + "\"", rawString.Substring(underscoreIndex + 1));
}
}
Parameters = parameters;
var eventInfo = node.Comment.Split(' ');
var argumentsRead = 0;
if (eventInfo.FirstOrDefault() == "Obsolete")
{
Obsolete = true;
argumentsRead++;
}
Level = eventInfo.Skip(argumentsRead++).FirstOrDefault() ?? "BadLevel";
EventId = eventInfo.Skip(argumentsRead++).FirstOrDefault() ?? "BadEventId";
Types = eventInfo.Skip(argumentsRead++).ToList();
}
public string Name { get; }
public string Value { get; }
public string EventId { get; }
public string Level { get; }
public bool Obsolete { get; }
public IEnumerable<(string NameOfString, string ParamString)> Parameters { get; }
public IEnumerable<string> Types { get; }
}
#>

View File

@@ -30,14 +30,14 @@ namespace FreeSql.ClickHouse
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
if (!string.IsNullOrEmpty(masterConnectionString))
MasterPool = isAdoPool ?
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new ClickHouseConnection(masterConnectionString)) as IObjectPool<DbConnection> :
new ClickHouseConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
new DbConnectionStringPool(base.DataType, CoreErrorStrings.S_MasterDatabase, () => new ClickHouseConnection(masterConnectionString)) as IObjectPool<DbConnection> :
new ClickHouseConnectionPool(CoreErrorStrings.S_MasterDatabase, masterConnectionString, null, null);
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
{
var slavePool = isAdoPool ?
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new ClickHouseConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
new ClickHouseConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
new DbConnectionStringPool(base.DataType, $"{CoreErrorStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new ClickHouseConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
new ClickHouseConnectionPool($"{CoreErrorStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
SlavePools.Add(slavePool);
});
}

View File

@@ -57,7 +57,7 @@ namespace FreeSql.ClickHouse
{
internal ClickHouseConnectionPool _pool;
public string Name { get; set; } = $"ClickHouse ClickHouseConnection {CoreStrings.S_ObjectPool}";
public string Name { get; set; } = $"ClickHouse ClickHouseConnection {CoreErrorStrings.S_ObjectPool}";
public int PoolSize { get; set; } = 100;
public TimeSpan SyncGetTimeout { get; set; } = TimeSpan.FromSeconds(10);
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromSeconds(20);
@@ -131,8 +131,8 @@ namespace FreeSql.ClickHouse
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
_pool.SetUnavailable(new Exception(CoreErrorStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreErrorStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && obj.Value.Ping() == false)
@@ -161,8 +161,8 @@ namespace FreeSql.ClickHouse
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
_pool.SetUnavailable(new Exception(CoreErrorStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreErrorStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && (await obj.Value.PingAsync()) == false)

View File

@@ -173,9 +173,9 @@ namespace FreeSql.ClickHouse
sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null)
throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false)
throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1)
tbname = new[] { database, tbname[0] };

View File

@@ -299,7 +299,7 @@ namespace FreeSql.ClickHouse
return _common.StringConcat(concatNewArrExp.Expressions.Select(a => getExp(a)).ToArray(), null);
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments.Count == 1) return ExpressionLambdaToSql(exp.Arguments[0], tsc);
var expArgsHack = exp.Arguments.Count == 2 && exp.Arguments[1].NodeType == ExpressionType.NewArrayInit ?
(exp.Arguments[1] as NewArrayExpression).Expressions : exp.Arguments.Where((a, z) => z > 0);

View File

@@ -17,7 +17,7 @@ namespace FreeSql.ClickHouse.Curd
{
}
public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreStrings.S_Not_Implemented_Feature}");
public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreErrorStrings.S_Not_Implemented_Feature}");
public override string ToSql()
{
@@ -59,7 +59,7 @@ namespace FreeSql.ClickHouse.Curd
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreStrings.S_Not_Implemented_Feature}");
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreErrorStrings.S_Not_Implemented_Feature}");
async public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default)
{

View File

@@ -30,7 +30,7 @@ namespace FreeSql.ClickHouse.Curd
public override int ExecuteAffrows() => SplitExecuteAffrows(_batchRowsLimit > 0 ? _batchRowsLimit : 500, _batchParameterLimit > 0 ? _batchParameterLimit : 3000);
protected override List<TReturn> ExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => base.SplitExecuteUpdated<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 500, _batchParameterLimit > 0 ? _batchParameterLimit : 3000, columns);
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreStrings.S_Not_Implemented_Feature}");
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreErrorStrings.S_Not_Implemented_Feature}");
protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys)
{
@@ -280,7 +280,7 @@ namespace FreeSql.ClickHouse.Curd
public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default) => SplitExecuteAffrowsAsync(_batchRowsLimit > 0 ? _batchRowsLimit : 500, _batchParameterLimit > 0 ? _batchParameterLimit : 3000, cancellationToken);
protected override Task<List<TReturn>> ExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 500, _batchParameterLimit > 0 ? _batchParameterLimit : 3000, columns, cancellationToken);
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreStrings.S_Not_Implemented_Feature}");
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.ClickHouse {CoreErrorStrings.S_Not_Implemented_Feature}");
async protected override Task SplitExecuteAsync(int valuesLimit, int parameterLimit, string traceName, Func<Task> executeAsync, CancellationToken cancellationToken = default)
{

View File

@@ -16,11 +16,11 @@ namespace FreeSql.Custom
{
}
public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
public override List<T1> ExecuteDeleted() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.S_Not_Implemented_Feature}");
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.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 {CoreStrings.S_Not_Implemented_Feature}");
protected override List<T1> RawExecuteInserted() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.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 {CoreStrings.S_Not_Implemented_Feature}");
protected override Task<List<T1>> RawExecuteInsertedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@@ -38,7 +38,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(CoreStrings.S_NotImplementSkipOffset("Custom"));
throw new NotImplementedException(CoreErrorStrings.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);
protected override List<TReturn> ExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => base.SplitExecuteUpdated<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255, columns);
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.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);
protected override Task<List<TReturn>> ExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : _utils.Adapter.UpdateBatchSplitLimit, _batchParameterLimit > 0 ? _batchParameterLimit : 255, columns, cancellationToken);
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@@ -24,7 +24,7 @@ namespace FreeSql.Custom
_CreateParameterCommand = CreateCommand();
return;
}
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
throw new Exception(CoreErrorStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
CustomAdapter Adapter => (_util == null ? FreeSqlCustomAdapterGlobalExtensions.DefaultAdapter : _util._orm.GetCustomAdapter());
@@ -68,7 +68,7 @@ namespace FreeSql.Custom
cmd.Connection = null;
return cmd;
}
throw new Exception(CoreStrings.S_CustomAdapter_Cannot_Use_CreateCommand);
throw new Exception(CoreErrorStrings.S_CustomAdapter_Cannot_Use_CreateCommand);
}
public DbParameter CreateParameter()
{

View File

@@ -90,6 +90,6 @@ namespace FreeSql.Custom
return null;
}
protected override string GetComparisonDDLStatements(params TypeSchemaAndName[] objects) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
protected override string GetComparisonDDLStatements(params TypeSchemaAndName[] objects) => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.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 {CoreStrings.S_Not_Implemented_Feature}");
public override IInsertOrUpdate<T1> CreateInsertOrUpdateProvider<T1>() => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.S_Not_Implemented_Feature}");
public override IDbFirst DbFirst => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreStrings.S_Not_Implemented_Feature}");
public override IDbFirst DbFirst => throw new NotImplementedException($"FreeSql.Provider.Custom {CoreErrorStrings.S_Not_Implemented_Feature}");
public CustomProvider(string masterConnectionString, string[] slaveConnectionString, Func<DbConnection> connectionFactory = null)
{

View File

@@ -86,7 +86,7 @@ namespace FreeSql.Custom.MySql
}
else
{
if (_tempPrimarys.Any() == false) throw new Exception(CoreStrings.Entity_Must_Primary_Key("fsql.InsertOrUpdate + IfExistsDoNothing + MySql ", _table.CsName));
if (_tempPrimarys.Any() == false) throw new Exception(CoreErrorStrings.Entity_Must_Primary_Key("fsql.InsertOrUpdate + IfExistsDoNothing + MySql ", _table.CsName));
sql = insert.ToSqlValuesOrSelectUnionAll();
if (sql?.StartsWith("INSERT INTO ") == true)
sql = $"INSERT IGNORE INTO {sql.Substring(12)}";

View File

@@ -17,7 +17,7 @@ namespace FreeSql.Custom.MySql
public CustomMySqlOnDuplicateKeyUpdate(IInsert<T1> insert)
{
_mysqlInsert = insert as CustomMySqlInsert<T1>;
if (_mysqlInsert == null) throw new Exception(CoreStrings.S_Features_Unique("OnDuplicateKeyUpdate", "Odbc/MySql"));
if (_mysqlInsert == null) throw new Exception(CoreErrorStrings.S_Features_Unique("OnDuplicateKeyUpdate", "Odbc/MySql"));
if (_mysqlInsert._noneParameterFlag == "c") _mysqlInsert._noneParameterFlag = "cu";
}

View File

@@ -24,7 +24,7 @@ namespace FreeSql.Custom.MySql
MasterPool = pool;
return;
}
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
throw new Exception(CoreErrorStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
{

View File

@@ -89,8 +89,8 @@ namespace FreeSql.Custom.MySql
{
if (sb.Length > 0) sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
if (tb == null) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1) tbname = new[] { database, tbname[0] };

View File

@@ -250,7 +250,7 @@ namespace FreeSql.Custom.MySql
return _common.StringConcat(concatNewArrExp.Expressions.Select(a => getExp(a)).ToArray(), null);
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments.Count == 1) return ExpressionLambdaToSql(exp.Arguments[0], tsc);
var expArgsHack = exp.Arguments.Count == 2 && exp.Arguments[1].NodeType == ExpressionType.NewArrayInit ?
(exp.Arguments[1] as NewArrayExpression).Expressions : exp.Arguments.Where((a, z) => z > 0);

View File

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

View File

@@ -32,7 +32,7 @@ namespace FreeSql.Custom.Oracle
string getMergeSql(List<T1> data)
{
if (_tempPrimarys.Any() == false) throw new Exception(CoreStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
if (_tempPrimarys.Any() == false) throw new Exception(CoreErrorStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
var tempPrimaryIsIdentity = _tempPrimarys.Any(b => b.Attribute.IsIdentity);
var sb = new StringBuilder().Append("MERGE INTO ").Append(_commonUtils.QuoteSqlName(TableRuleInvoke())).Append(" t1 \r\nUSING (");

View File

@@ -22,7 +22,7 @@ namespace FreeSql.Custom.Oracle
public override int ExecuteAffrows() => base.SplitExecuteAffrows(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999);
protected override List<TReturn> ExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => base.SplitExecuteUpdated<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, columns);
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Custom.Oracle {CoreStrings.S_Not_Implemented_Feature}");
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Custom.Oracle {CoreErrorStrings.S_Not_Implemented_Feature}");
protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys)
{
@@ -68,7 +68,7 @@ namespace FreeSql.Custom.Oracle
public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default) => base.SplitExecuteAffrowsAsync(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, cancellationToken);
protected override Task<List<TReturn>> ExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, columns, cancellationToken);
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Custom.Oracle {CoreStrings.S_Not_Implemented_Feature}");
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Custom.Oracle {CoreErrorStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@@ -27,7 +27,7 @@ namespace FreeSql.Custom.Oracle
UserId = CustomOracleAdo.GetUserId(conn.Value.ConnectionString);
return;
}
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
throw new Exception(CoreErrorStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
internal string UserId { get; set; }

View File

@@ -91,8 +91,8 @@ namespace FreeSql.Custom.Oracle
{
if (sb.Length > 0) sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
if (tb == null) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1) tbname = new[] { userId, tbname[0] };
@@ -113,7 +113,7 @@ namespace FreeSql.Custom.Oracle
//codefirst 不支持表名中带 .
if (string.Compare(tbname[0], userId) != 0 && _orm.Ado.ExecuteScalar(CommandType.Text, _commonUtils.FormatSql(" select 1 from sys.dba_users where username={0}", tbname[0])) == null) //创建数据库
throw new NotImplementedException(CoreStrings.S_Oracle_NotSupport_TablespaceSchemas(tbname[0]));
throw new NotImplementedException(CoreErrorStrings.S_Oracle_NotSupport_TablespaceSchemas(tbname[0]));
var sbalter = new StringBuilder();
var istmpatler = false; //创建临时表,导入数据,删除旧表,修改

View File

@@ -112,7 +112,7 @@ namespace FreeSql.Custom.Oracle
if (dbfull != null) _dicDbToCs.TryAdd(dbfull, _dicDbToCs["nvarchar2(255)"]);
return DbType.String;
}
throw new NotImplementedException(CoreStrings.S_TypeMappingNotImplemented(column.DbTypeTextFull));
throw new NotImplementedException(CoreErrorStrings.S_TypeMappingNotImplemented(column.DbTypeTextFull));
}
static ConcurrentDictionary<string, DbToCs> _dicDbToCs = new ConcurrentDictionary<string, DbToCs>(StringComparer.CurrentCultureIgnoreCase);

View File

@@ -254,7 +254,7 @@ namespace FreeSql.Custom.Oracle
return _common.StringConcat(concatNewArrExp.Expressions.Select(a => getExp(a)).ToArray(), null);
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
var expArgsHack = exp.Arguments.Count == 2 && exp.Arguments[1].NodeType == ExpressionType.NewArrayInit ?
(exp.Arguments[1] as NewArrayExpression).Expressions : exp.Arguments.Where((a, z) => z > 0);
//3个 {} 时Arguments 解析出来是分开的

View File

@@ -24,7 +24,7 @@ namespace FreeSql.Custom.PostgreSQL
public CustomPostgreSQLOnConflictDoUpdate(IInsert<T1> insert, Expression<Func<T1, object>> columns = null)
{
_pgsqlInsert = insert as CustomPostgreSQLInsert<T1>;
if (_pgsqlInsert == null) throw new Exception(CoreStrings.S_Features_Unique("OnConflictDoUpdate", "Custom/PostgreSQL"));
if (_pgsqlInsert == null) throw new Exception(CoreErrorStrings.S_Features_Unique("OnConflictDoUpdate", "Custom/PostgreSQL"));
if (_pgsqlInsert._noneParameterFlag == "c") _pgsqlInsert._noneParameterFlag = "cu";
if (columns != null)
@@ -38,7 +38,7 @@ namespace FreeSql.Custom.PostgreSQL
}
if (_tempPrimarys == null || _tempPrimarys.Any() == false)
_tempPrimarys = _pgsqlInsert.InternalTable.Primarys;
if (_tempPrimarys.Any() == false) throw new Exception(CoreStrings.S_OnConflictDoUpdate_MustIsPrimary);
if (_tempPrimarys.Any() == false) throw new Exception(CoreErrorStrings.S_OnConflictDoUpdate_MustIsPrimary);
}
protected void ClearData()

View File

@@ -25,7 +25,7 @@ namespace FreeSql.Custom.PostgreSQL
MasterPool = pool;
return;
}
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
throw new Exception(CoreErrorStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)

View File

@@ -92,8 +92,8 @@ namespace FreeSql.Custom.PostgreSQL
{
if (sb.Length > 0) sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
if (tb == null) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1) tbname = new[] { "public", tbname[0] };

View File

@@ -338,7 +338,7 @@ namespace FreeSql.Custom.PostgreSQL
return _common.StringConcat(concatNewArrExp.Expressions.Select(a => getExp(a)).ToArray(), null);
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
var expArgsHack = exp.Arguments.Count == 2 && exp.Arguments[1].NodeType == ExpressionType.NewArrayInit ?
(exp.Arguments[1] as NewArrayExpression).Expressions : exp.Arguments.Where((a, z) => z > 0);
//3个 {} 时Arguments 解析出来是分开的

View File

@@ -40,7 +40,7 @@ namespace FreeSql.Custom.SqlServer
}
var sql = sb.ToString();
var validx = sql.IndexOf(" WHERE ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("WHERE"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("WHERE"));
sql = sb.Clear().Append(sql.Substring(0, validx))
.Append(sbret)
.Append(sql.Substring(validx)).ToString();
@@ -97,7 +97,7 @@ namespace FreeSql.Custom.SqlServer
}
var sql = sb.ToString();
var validx = sql.IndexOf(" WHERE ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("WHERE"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("WHERE"));
sql = sb.Clear().Append(sql.Substring(0, validx))
.Append(sbret)
.Append(sql.Substring(validx)).ToString();

View File

@@ -69,14 +69,14 @@ namespace FreeSql.Custom.SqlServer
if ((_commonUtils as CustomSqlServerUtils).ServerVersion > 10)
{
var validx = sql.IndexOf(") VALUES");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("VALUES"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("VALUES"));
sb.Insert(0, sql.Substring(0, validx + 1));
sb.Append(sql.Substring(validx + 1));
}
else
{
var validx = sql.IndexOf(") SELECT ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("SELECT"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("SELECT"));
sb.Insert(0, sql.Substring(0, validx + 1));
sb.Append(sql.Substring(validx + 1));
}
@@ -153,14 +153,14 @@ namespace FreeSql.Custom.SqlServer
if ((_commonUtils as CustomSqlServerUtils).ServerVersion > 10)
{
var validx = sql.IndexOf(") VALUES");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("VALUES"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("VALUES"));
sb.Insert(0, sql.Substring(0, validx + 1));
sb.Append(sql.Substring(validx + 1));
}
else
{
var validx = sql.IndexOf(") SELECT ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("SELECT"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("SELECT"));
sb.Insert(0, sql.Substring(0, validx + 1));
sb.Append(sql.Substring(validx + 1));
}

View File

@@ -32,7 +32,7 @@ namespace FreeSql.Custom.SqlServer
string getMergeSql(List<T1> data)
{
if (_tempPrimarys.Any() == false) throw new Exception(CoreStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
if (_tempPrimarys.Any() == false) throw new Exception(CoreErrorStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
var tempPrimaryIsIdentity = _tempPrimarys.Any(b => b.Attribute.IsIdentity);
var sb = new StringBuilder();

View File

@@ -46,7 +46,7 @@ namespace FreeSql.Custom.SqlServer
}
var sql = sb.ToString();
var validx = sql.IndexOf(" \r\nWHERE ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("WHERE"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("WHERE"));
sql = sb.Clear().Append(sql.Substring(0, validx))
.Append(sbret)
.Append(sql.Substring(validx)).ToString();
@@ -140,7 +140,7 @@ namespace FreeSql.Custom.SqlServer
}
var sql = sb.ToString();
var validx = sql.IndexOf(" \r\nWHERE ");
if (validx == -1) throw new ArgumentException(CoreStrings.S_NotFound_Name("WHERE"));
if (validx == -1) throw new ArgumentException(CoreErrorStrings.S_NotFound_Name("WHERE"));
sql = sb.Clear().Append(sql.Substring(0, validx))
.Append(sbret)
.Append(sql.Substring(validx)).ToString();

View File

@@ -25,7 +25,7 @@ namespace FreeSql.Custom.SqlServer
MasterPool = pool;
return;
}
throw new Exception(CoreStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
throw new Exception(CoreErrorStrings.S_CustomAdapter_OnlySuppport_UseConnectionFactory);
}
string[] ncharDbTypes = new[] { "NVARCHAR", "NCHAR", "NTEXT" };

View File

@@ -149,8 +149,8 @@ ELSE
{
if (sb.Length > 0) sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
if (tb == null) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1) tbname = new[] { database, "dbo", tbname[0] };
if (tbname?.Length == 2) tbname = new[] { database, tbname[0], tbname[1] };

View File

@@ -260,7 +260,7 @@ namespace FreeSql.Custom.SqlServer
return _common.StringConcat(concatNewArrExp.Expressions.Select(a => getExp(a)).ToArray(), concatNewArrExp.Expressions.Select(a => a.Type).ToArray());
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), exp.Arguments.Select(a => a.Type).ToArray());
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception(CoreErrorStrings.Not_Implemented_Expression_ParameterUseConstant(exp,exp.Arguments[0]));
var expArgs0 = ExpressionLambdaToSql(exp.Arguments[0], tsc);
if (exp.Arguments.Count == 1) return expArgs0;
var nchar = expArgs0.StartsWith("N'") ? "N" : "";

View File

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

View File

@@ -32,7 +32,7 @@ namespace FreeSql.Dameng.Curd
string getMergeSql(List<T1> data)
{
if (_tempPrimarys.Any() == false) throw new Exception(CoreStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
if (_tempPrimarys.Any() == false) throw new Exception(CoreErrorStrings.InsertOrUpdate_Must_Primary_Key(_table.CsName));
var tempPrimaryIsIdentity = _tempPrimarys.Any(b => b.Attribute.IsIdentity);
var sb = new StringBuilder().Append("MERGE INTO ").Append(_commonUtils.QuoteSqlName(TableRuleInvoke())).Append(" t1 \r\nUSING (");

View File

@@ -21,7 +21,7 @@ namespace FreeSql.Dameng.Curd
public override int ExecuteAffrows() => base.SplitExecuteAffrows(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999);
protected override List<TReturn> ExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => base.SplitExecuteUpdated<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, columns);
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.Dameng {CoreStrings.S_Not_Implemented_Feature}");
protected override List<TReturn> RawExecuteUpdated<TReturn>(IEnumerable<ColumnInfo> columns) => throw new NotImplementedException($"FreeSql.Provider.Dameng {CoreErrorStrings.S_Not_Implemented_Feature}");
protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys)
{
@@ -65,7 +65,7 @@ namespace FreeSql.Dameng.Curd
public override Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default) => base.SplitExecuteAffrowsAsync(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, cancellationToken);
protected override Task<List<TReturn>> ExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => base.SplitExecuteUpdatedAsync<TReturn>(_batchRowsLimit > 0 ? _batchRowsLimit : 200, _batchParameterLimit > 0 ? _batchParameterLimit : 999, columns, cancellationToken);
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Dameng {CoreStrings.S_Not_Implemented_Feature}");
protected override Task<List<TReturn>> RawExecuteUpdatedAsync<TReturn>(IEnumerable<ColumnInfo> columns, CancellationToken cancellationToken = default) => throw new NotImplementedException($"FreeSql.Provider.Dameng {CoreErrorStrings.S_Not_Implemented_Feature}");
#endif
}
}

View File

@@ -29,14 +29,14 @@ namespace FreeSql.Dameng
if (isAdoPool) masterConnectionString = masterConnectionString.Substring("AdoConnectionPool,".Length);
if (!string.IsNullOrEmpty(masterConnectionString))
MasterPool = isAdoPool ?
new DbConnectionStringPool(base.DataType, CoreStrings.S_MasterDatabase, () => new DmConnection(masterConnectionString)) as IObjectPool<DbConnection> :
new DamengConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
new DbConnectionStringPool(base.DataType, CoreErrorStrings.S_MasterDatabase, () => new DmConnection(masterConnectionString)) as IObjectPool<DbConnection> :
new DamengConnectionPool(CoreErrorStrings.S_MasterDatabase, masterConnectionString, null, null);
slaveConnectionStrings?.ToList().ForEach(slaveConnectionString =>
{
var slavePool = isAdoPool ?
new DbConnectionStringPool(base.DataType, $"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new DmConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
new DamengConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
new DbConnectionStringPool(base.DataType, $"{CoreErrorStrings.S_SlaveDatabase}{SlavePools.Count + 1}", () => new DmConnection(slaveConnectionString)) as IObjectPool<DbConnection> :
new DamengConnectionPool($"{CoreErrorStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
SlavePools.Add(slavePool);
});
}

View File

@@ -54,7 +54,7 @@ namespace FreeSql.Dameng
{
internal DamengConnectionPool _pool;
public string Name { get; set; } = $"Dameng DmConnection {CoreStrings.S_ObjectPool}";
public string Name { get; set; } = $"Dameng DmConnection {CoreErrorStrings.S_ObjectPool}";
public int PoolSize { get; set; } = 100;
public TimeSpan SyncGetTimeout { get; set; } = TimeSpan.FromSeconds(10);
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromSeconds(20);
@@ -130,8 +130,8 @@ namespace FreeSql.Dameng
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
_pool.SetUnavailable(new Exception(CoreErrorStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreErrorStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && obj.Value.Ping() == false)
@@ -160,8 +160,8 @@ namespace FreeSql.Dameng
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
_pool.SetUnavailable(new Exception(CoreErrorStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreErrorStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && (await obj.Value.PingAsync()) == false)

View File

@@ -92,8 +92,8 @@ namespace FreeSql.Dameng
{
if (sb.Length > 0) sb.Append("\r\n");
var tb = obj.tableSchema;
if (tb == null) throw new Exception(CoreStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
if (tb == null) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable(obj.tableSchema.Type.FullName));
if (tb.Columns.Any() == false) throw new Exception(CoreErrorStrings.S_Type_IsNot_Migrable_0Attributes(obj.tableSchema.Type.FullName));
var tbname = _commonUtils.SplitTableName(tb.DbName);
if (tbname?.Length == 1) tbname = new[] { userId, tbname[0] };
@@ -114,7 +114,7 @@ namespace FreeSql.Dameng
//codefirst 不支持表名中带 .
if (string.Compare(tbname[0], userId) != 0 && _orm.Ado.ExecuteScalar(CommandType.Text, _commonUtils.FormatSql(" select 1 from sys.dba_users where username={0}", tbname[0])) == null) //创建数据库
throw new NotImplementedException(CoreStrings.S_Dameng_NotSupport_TablespaceSchemas(tbname[0]));
throw new NotImplementedException(CoreErrorStrings.S_Dameng_NotSupport_TablespaceSchemas(tbname[0]));
var sbalter = new StringBuilder();
var istmpatler = false; //创建临时表,导入数据,删除旧表,修改

View File

@@ -165,7 +165,7 @@ namespace FreeSql.Dameng
if (dbfull != null) _dicDbToCs.TryAdd(dbfull, _dicDbToCs["nvarchar2(255)"]);
return DmDbType.VarChar;
}
throw new NotImplementedException(CoreStrings.S_TypeMappingNotImplemented(column.DbTypeTextFull));
throw new NotImplementedException(CoreErrorStrings.S_TypeMappingNotImplemented(column.DbTypeTextFull));
}
static ConcurrentDictionary<string, DbToCs> _dicDbToCs = new ConcurrentDictionary<string, DbToCs>(StringComparer.CurrentCultureIgnoreCase);

Some files were not shown because too many files have changed in this diff Show More