build: 10.8.24

fix: 变量离线后再次上线,如果值不变,会导致在线状态不刷新
fix: s7离线恢复时,可能触发多次协议握手导致异常
This commit is contained in:
Diego
2025-06-25 11:17:04 +08:00
parent 6510c3e289
commit c80e57a4e8
82 changed files with 380 additions and 396 deletions

View File

@@ -85,7 +85,7 @@
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
as of the date such litigation is field.
4. Cachetribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without

View File

@@ -79,11 +79,6 @@ public abstract class DisposeBase : IDisposable2
OnDisposed?.Invoke(this, EventArgs.Empty);
}
///// <summary>释放资源参数表示是否由Dispose调用。该方法保证OnDispose只被调用一次</summary>
///// <param name="disposing"></param>
//[Obsolete("=>Dispose")]
//protected virtual void OnDispose(Boolean disposing) { }
/// <summary>析构函数</summary>
/// <remarks>
/// 如果忘记调用Dispose这里会释放非托管资源。

View File

@@ -95,7 +95,6 @@ public class Config<TConfig> where TConfig : Config<TConfig>, new()
#region
/// <summary>是否新的配置文件</summary>
[XmlIgnore, IgnoreDataMember]
//[Obsolete("=>_Provider.IsNew")]
public Boolean IsNew => Provider?.IsNew ?? false;
#endregion
@@ -104,7 +103,6 @@ public class Config<TConfig> where TConfig : Config<TConfig>, new()
protected virtual void OnLoaded() { }
/// <summary>保存到配置文件中去</summary>
//[Obsolete("=>Provider.Save")]
public virtual void Save() => Provider?.Save(this);
#endregion
}

View File

@@ -41,12 +41,6 @@ public static class ProcessHelper
return pname;
}
/// <summary>获取二级进程名</summary>
/// <param name="process"></param>
/// <returns></returns>
[Obsolete("=>GetProcessName", true)]
public static String GetProcessName2(this Process process) => GetProcessName(process);
///// <summary>根据名称获取进程。支持dotnet/java</summary>
///// <param name="name"></param>
///// <returns></returns>

View File

@@ -236,25 +236,6 @@ public static class StringHelper
return sb.Return(true);
}
///// <summary>把一个列表组合成为一个字符串,默认逗号分隔</summary>
///// <param name="value"></param>
///// <param name="separator">组合分隔符,默认逗号</param>
///// <param name="func">把对象转为字符串的委托</param>
///// <returns></returns>
//[Obsolete]
//public static String Join<T>(this IEnumerable<T> value, String separator, Func<T, String>? func)
//{
// var sb = Pool.StringBuilder.Get();
// if (value != null)
// {
// if (func == null) func = obj => obj + "";
// foreach (var item in value)
// {
// sb.Separate(separator).Append(func(item));
// }
// }
// return sb.Put(true);
//}
/// <summary>把一个列表组合成为一个字符串,默认逗号分隔</summary>
/// <param name="value"></param>
@@ -301,28 +282,6 @@ public static class StringHelper
return encoding.GetBytes(value);
}
/// <summary>格式化字符串。特别支持无格式化字符串的时间参数</summary>
/// <param name="value">格式字符串</param>
/// <param name="args">参数</param>
/// <returns></returns>
[Obsolete("建议使用插值字符串")]
public static String F(this String value, params Object?[] args)
{
if (String.IsNullOrEmpty(value)) return value;
// 特殊处理时间格式化。这些年,无数项目实施因为时间格式问题让人发狂
for (var i = 0; i < args.Length; i++)
{
if (args[i] is DateTime dt)
{
// 没有写格式化字符串的时间参数,一律转为标准时间字符串
if (value.Contains("{" + i + "}")) args[i] = dt.ToFullString();
}
}
return String.Format(value, args);
}
/// <summary>指定输入是否匹配目标表达式,支持*匹配</summary>
/// <param name="pattern">匹配表达式</param>
/// <param name="input">输入字符串</param>

View File

@@ -1,15 +0,0 @@
namespace ThingsGateway.NewLife.Reflection
{
/// <summary>
/// 索引器接访问口。
/// 该接口用于通过名称快速访问对象属性或字段(属性优先)。
/// </summary>
//[Obsolete("=>IIndex")]
public interface IIndexAccessor
{
/// <summary>获取/设置 指定名称的属性或字段的值</summary>
/// <param name="name">名称</param>
/// <returns></returns>
Object this[String name] { get; set; }
}
}

View File

@@ -521,12 +521,7 @@ public static class Reflect
/// <returns></returns>
public static IEnumerable<Type> GetAllSubclasses(this Type baseType) => Provider.GetAllSubclasses(baseType);
///// <summary>在所有程序集中查找指定基类或接口的子类实现</summary>
///// <param name="baseType">基类或接口</param>
///// <param name="isLoadAssembly">是否加载为加载程序集</param>
///// <returns></returns>
//[Obsolete]
//public static IEnumerable<Type> GetAllSubclasses(this Type baseType, Boolean isLoadAssembly) => Provider.GetAllSubclasses(baseType, isLoadAssembly);
#endregion
#region

View File

@@ -20,7 +20,6 @@ namespace ThingsGateway.NewLife.Xml;
/// 用户也可以通过配置实体类的静态构造函数修改基类的<see cref="_.ConfigFile"/>和<see cref="_.ReloadTime"/>来动态配置加载信息。
/// </remarks>
/// <typeparam name="TConfig"></typeparam>
//[Obsolete("=>Config<TConfig>")]
public class XmlConfig<TConfig> : DisposeBase where TConfig : XmlConfig<TConfig>, new()
{
#region

View File

@@ -10,8 +10,6 @@
using System.Reflection;
using ThingsGateway.NewLife.Caching;
namespace ThingsGateway.Extension.Generic;
/// <inheritdoc/>

View File

@@ -355,7 +355,7 @@ namespace ThingsGateway.SqlSugar
{
var querybulder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
querybulder.Context = this.Context;
var fileds = item.IndexFields
var fields = item.IndexFields
.Select(it =>
{
var dbColumn = entityInfo.Columns.FirstOrDefault(z => z.PropertyName == it.Key);
@@ -366,7 +366,7 @@ namespace ThingsGateway.SqlSugar
return new KeyValuePair<string, OrderByType>(dbColumn.DbColumnName, it.Value);
})
.Select(it => querybulder.GetTranslationColumnName(it.Key) + " " + it.Value).ToArray();
this.Context.DbMaintenance.CreateIndex(entityInfo.DbTableName, fileds, item.IndexName + include, item.IsUnique);
this.Context.DbMaintenance.CreateIndex(entityInfo.DbTableName, fields, item.IndexName + include, item.IsUnique);
}
}
}
@@ -384,7 +384,7 @@ namespace ThingsGateway.SqlSugar
DbColumnInfo dbColumnInfo = EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();

View File

@@ -154,7 +154,7 @@ namespace ThingsGateway.SqlSugar
if (DeleteBuilder.BigDataInValues == null)
DeleteBuilder.BigDataInValues = new List<object>();
DeleteBuilder.BigDataInValues.AddRange(primaryKeyValues);
DeleteBuilder.BigDataFiled = primaryField;
DeleteBuilder.BigDataField = primaryField;
}
}
else
@@ -520,7 +520,7 @@ namespace ThingsGateway.SqlSugar
if (DeleteBuilder.BigDataInValues == null)
DeleteBuilder.BigDataInValues = new List<object>();
DeleteBuilder.BigDataInValues.AddRange(primaryKeyValues.Select(it => (object)it));
DeleteBuilder.BigDataFiled = primaryField;
DeleteBuilder.BigDataField = primaryField;
}
return this;
}

View File

@@ -35,7 +35,7 @@ namespace ThingsGateway.SqlSugar
attributeType.GetProperty(nameof(SugarTable.TableDescription)) ,
attributeType.GetProperty(nameof(SugarTable.IsDisabledUpdateAll)) ,
attributeType.GetProperty(nameof(SugarTable.IsDisabledDelete)),
attributeType.GetProperty(nameof(SugarTable.IsCreateTableFiledSort)),
attributeType.GetProperty(nameof(SugarTable.IsCreateTableFieldSort)),
attributeType.GetProperty(nameof(SugarTable.Discrimator))
}
, new object[] {
@@ -43,7 +43,7 @@ namespace ThingsGateway.SqlSugar
sugarTable.TableDescription ,
sugarTable.IsDisabledUpdateAll,
sugarTable.IsDisabledDelete,
sugarTable.IsCreateTableFiledSort,
sugarTable.IsCreateTableFieldSort,
sugarTable.Discrimator
});
return attributeBuilder;

View File

@@ -63,7 +63,7 @@ namespace ThingsGateway.SqlSugar
result.TableDescription = sugarTable.TableDescription.ToSqlFilter();
result.IsDisabledUpdateAll = sugarTable.IsDisabledUpdateAll;
result.IsDisabledDelete = sugarTable.IsDisabledDelete;
result.IsCreateTableFiledSort = sugarTable.IsCreateTableFiledSort;
result.IsCreateTableFieldSort = sugarTable.IsCreateTableFieldSort;
result.Discrimator = sugarTable.Discrimator;
}
var indexs = type.GetCustomAttributes(typeof(SugarIndexAttribute));

View File

@@ -566,11 +566,11 @@ namespace ThingsGateway.SqlSugar
foreach (var item in this.EntityInfo.Columns.Where(it => it.IsIgnore == false && GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase))))
{
var fielddName = item.DbColumnName;
var filedObject = this.EntityInfo.Columns.FirstOrDefault(it => it.PropertyName == item.PropertyName).PropertyInfo.GetValue(this.InsertObjs.Last(), null);
var fieldValue = filedObject.ObjToString();
if (filedObject != null && filedObject.GetType() != typeof(string) && this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
var fieldObject = this.EntityInfo.Columns.FirstOrDefault(it => it.PropertyName == item.PropertyName).PropertyInfo.GetValue(this.InsertObjs.Last(), null);
var fieldValue = fieldObject.ObjToString();
if (fieldObject != null && fieldObject.GetType() != typeof(string) && this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
{
cons.Add(new ConditionalModel() { ConditionalType = ConditionalType.Equal, FieldName = fielddName, FieldValue = fieldValue, FieldValueConvertFunc = it => UtilMethods.ChangeType2(it, filedObject.GetType()) });
cons.Add(new ConditionalModel() { ConditionalType = ConditionalType.Equal, FieldName = fielddName, FieldValue = fieldValue, FieldValueConvertFunc = it => UtilMethods.ChangeType2(it, fieldObject.GetType()) });
}
else
{

View File

@@ -73,11 +73,6 @@ namespace ThingsGateway.SqlSugar
return resul;
}
[Obsolete("use ExecuteCommand")]
public object ExecuteReturnPrimaryKey()
{
return ExecuteCommand();
}
public async Task<object> ExecuteCommandAsync()
{
@@ -137,11 +132,7 @@ namespace ThingsGateway.SqlSugar
return 0;
}
}
[Obsolete("use ExecuteCommandAsync")]
public Task<object> ExecuteReturnPrimaryKeyAsync()
{
return Task.FromResult(ExecuteReturnPrimaryKey());
}
private bool IsIdEntity(EntityInfo entity)
{

View File

@@ -9,17 +9,17 @@ namespace ThingsGateway.SqlSugar
public EntityInfo NavEntity { get; set; }
public EntityInfo RootEntity { get; set; }
public MappingFieldsInfo GetMappings(Expression thisFiled, Expression mappingFiled)
public MappingFieldsInfo GetMappings(Expression thisField, Expression mappingField)
{
MappingFieldsInfo mappingFields = new MappingFieldsInfo();
var pkName = "";
if ((mappingFiled as LambdaExpression).Body is UnaryExpression)
if ((mappingField as LambdaExpression).Body is UnaryExpression)
{
pkName = (((mappingFiled as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
pkName = (((mappingField as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
}
else
{
pkName = ((mappingFiled as LambdaExpression).Body as MemberExpression).Member.Name;
pkName = ((mappingField as LambdaExpression).Body as MemberExpression).Member.Name;
}
return mappingFields;
}

View File

@@ -577,7 +577,7 @@ namespace ThingsGateway.SqlSugar
var result = new List<T>();
throw new Exception("开发中");
}
public List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisFiled, Expression<Func<object>> mappingFiled, ParameterT parameter)
public List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisField, Expression<Func<object>> mappingField, ParameterT parameter)
{
if (parameter == null)
{
@@ -588,15 +588,15 @@ namespace ThingsGateway.SqlSugar
var queryableContext = this.Context.TempItems["Queryable_To_Context"] as MapperContext<ParameterT>;
var list = queryableContext.list;
var pkName = "";
if ((mappingFiled as LambdaExpression).Body is UnaryExpression)
if ((mappingField as LambdaExpression).Body is UnaryExpression)
{
pkName = (((mappingFiled as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
pkName = (((mappingField as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
}
else
{
pkName = ((mappingFiled as LambdaExpression).Body as MemberExpression).Member.Name;
pkName = ((mappingField as LambdaExpression).Body as MemberExpression).Member.Name;
}
var key = thisFiled.ToString() + mappingFiled.ToString() + typeof(ParameterT).FullName + typeof(T).FullName;
var key = thisField.ToString() + mappingField.ToString() + typeof(ParameterT).FullName + typeof(T).FullName;
var ids = list.Where(it => it != null).Select(it => it.GetType().GetProperty(pkName).GetValue(it)).Distinct().ToArray();
if (queryableContext.TempChildLists == null)
queryableContext.TempChildLists = new Dictionary<string, object>();
@@ -610,25 +610,25 @@ namespace ThingsGateway.SqlSugar
queryableContext.TempChildLists = new Dictionary<string, object>();
this.Context.Utilities.PageEach(ids, 200, pageIds =>
{
result.AddRange(this.Clone().In(thisFiled, pageIds).ToList());
result.AddRange(this.Clone().In(thisField, pageIds).ToList());
});
queryableContext.TempChildLists[key] = result;
}
var name = "";
if ((thisFiled as LambdaExpression).Body is UnaryExpression)
if ((thisField as LambdaExpression).Body is UnaryExpression)
{
name = (((thisFiled as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
name = (((thisField as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
}
else
{
name = ((thisFiled as LambdaExpression).Body as MemberExpression).Member.Name;
name = ((thisField as LambdaExpression).Body as MemberExpression).Member.Name;
}
var pkValue = parameter.GetType().GetProperty(pkName).GetValue(parameter);
result = result.Where(it => it.GetType().GetProperty(name).GetValue(it).ObjToString() == pkValue.ObjToString()).ToList();
return result;
}
public List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisFiled1, Expression<Func<object>> mappingFiled1,
Expression<Func<T, object>> thisFiled2, Expression<Func<object>> mappingFiled2,
public List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisField1, Expression<Func<object>> mappingField1,
Expression<Func<T, object>> thisField2, Expression<Func<object>> mappingField2,
ParameterT parameter)
{
if (parameter == null)
@@ -640,22 +640,22 @@ namespace ThingsGateway.SqlSugar
List<T> result = new List<T>();
var queryableContext = this.Context.TempItems["Queryable_To_Context"] as MapperContext<ParameterT>;
var list = queryableContext.list;
var key = thisFiled1.ToString() + mappingFiled1.ToString() +
thisFiled2.ToString() + mappingFiled2.ToString() +
var key = thisField1.ToString() + mappingField1.ToString() +
thisField2.ToString() + mappingField2.ToString() +
typeof(ParameterT).FullName + typeof(T).FullName;
MappingFieldsHelper<ParameterT> fieldsHelper = new MappingFieldsHelper<ParameterT>();
var mappings = new List<MappingFieldsExpression>() {
new MappingFieldsExpression(){
LeftColumnExpression=thisFiled1,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisFiled1)),
RightColumnExpression=mappingFiled1,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingFiled1))
LeftColumnExpression=thisField1,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisField1)),
RightColumnExpression=mappingField1,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingField1))
},
new MappingFieldsExpression(){
LeftColumnExpression=thisFiled2,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisFiled2)),
RightColumnExpression=mappingFiled2,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingFiled2))
LeftColumnExpression=thisField2,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisField2)),
RightColumnExpression=mappingField2,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingField2))
}
};
var conditionals = fieldsHelper.GetMppingSql(list.Cast<object>().ToList(), mappings);

View File

@@ -502,8 +502,8 @@ namespace ThingsGateway.SqlSugar
totalNumber.Value = count;
}
public async Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisFiled1, Expression<Func<object>> mappingFiled1,
Expression<Func<T, object>> thisFiled2, Expression<Func<object>> mappingFiled2,
public async Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisField1, Expression<Func<object>> mappingField1,
Expression<Func<T, object>> thisField2, Expression<Func<object>> mappingField2,
ParameterT parameter)
{
if (parameter == null)
@@ -515,22 +515,22 @@ ParameterT parameter)
List<T> result = new List<T>();
var queryableContext = this.Context.TempItems["Queryable_To_Context"] as MapperContext<ParameterT>;
var list = queryableContext.list;
var key = thisFiled1.ToString() + mappingFiled1.ToString() +
thisFiled2.ToString() + mappingFiled2.ToString() +
var key = thisField1.ToString() + mappingField1.ToString() +
thisField2.ToString() + mappingField2.ToString() +
typeof(ParameterT).FullName + typeof(T).FullName;
MappingFieldsHelper<ParameterT> fieldsHelper = new MappingFieldsHelper<ParameterT>();
var mappings = new List<MappingFieldsExpression>() {
new MappingFieldsExpression(){
LeftColumnExpression=thisFiled1,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisFiled1)),
RightColumnExpression=mappingFiled1,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingFiled1))
LeftColumnExpression=thisField1,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisField1)),
RightColumnExpression=mappingField1,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingField1))
},
new MappingFieldsExpression(){
LeftColumnExpression=thisFiled2,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisFiled2)),
RightColumnExpression=mappingFiled2,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingFiled2))
LeftColumnExpression=thisField2,
LeftEntityColumn=leftEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(thisField2)),
RightColumnExpression=mappingField2,
RightEntityColumn=rightEntity.Columns.First(it=>it.PropertyName==ExpressionTool.GetMemberName(mappingField2))
}
};
var conditionals = fieldsHelper.GetMppingSql(list.Cast<object>().ToList(), mappings);
@@ -550,22 +550,22 @@ ParameterT parameter)
var newResult = fieldsHelper.GetSetList(obj, listObj, mappings).Select(it => (T)it).ToList();
return newResult;
}
public async Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisFiled, Expression<Func<object>> mappingFiled, ParameterT parameter)
public async Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisField, Expression<Func<object>> mappingField, ParameterT parameter)
{
List<T> result = new List<T>();
var entity = this.Context.EntityMaintenance.GetEntityInfo<ParameterT>();
var queryableContext = this.Context.TempItems["Queryable_To_Context"] as MapperContext<ParameterT>;
var list = queryableContext.list;
var pkName = "";
if ((mappingFiled as LambdaExpression).Body is UnaryExpression)
if ((mappingField as LambdaExpression).Body is UnaryExpression)
{
pkName = (((mappingFiled as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
pkName = (((mappingField as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
}
else
{
pkName = ((mappingFiled as LambdaExpression).Body as MemberExpression).Member.Name;
pkName = ((mappingField as LambdaExpression).Body as MemberExpression).Member.Name;
}
var key = thisFiled.ToString() + mappingFiled.ToString() + typeof(ParameterT).FullName + typeof(T).FullName;
var key = thisField.ToString() + mappingField.ToString() + typeof(ParameterT).FullName + typeof(T).FullName;
var ids = list.Select(it => it.GetType().GetProperty(pkName).GetValue(it)).ToArray();
if (queryableContext.TempChildLists == null)
queryableContext.TempChildLists = new Dictionary<string, object>();
@@ -579,18 +579,18 @@ ParameterT parameter)
queryableContext.TempChildLists = new Dictionary<string, object>();
await Context.Utilities.PageEachAsync(ids, 200, async pageIds =>
{
result.AddRange(await Clone().In(thisFiled, pageIds).ToListAsync().ConfigureAwait(false));
result.AddRange(await Clone().In(thisField, pageIds).ToListAsync().ConfigureAwait(false));
}).ConfigureAwait(false);
queryableContext.TempChildLists[key] = result;
}
var name = "";
if ((thisFiled as LambdaExpression).Body is UnaryExpression)
if ((thisField as LambdaExpression).Body is UnaryExpression)
{
name = (((thisFiled as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
name = (((thisField as LambdaExpression).Body as UnaryExpression).Operand as MemberExpression).Member.Name;
}
else
{
name = ((thisFiled as LambdaExpression).Body as MemberExpression).Member.Name;
name = ((thisField as LambdaExpression).Body as MemberExpression).Member.Name;
}
var pkValue = parameter.GetType().GetProperty(pkName).GetValue(parameter);
result = result.Where(it => it.GetType().GetProperty(name).GetValue(it).ObjToString() == pkValue.ObjToString()).ToList();

View File

@@ -952,17 +952,17 @@ namespace ThingsGateway.SqlSugar
var mapperFieldExp = mapperField as MemberExpression;
Check.Exception(mapperFieldExp.Type.IsClass(), ".Mapper() parameter error");
var objType = mapperObjectExp.Type;
var filedType = mapperFieldExp.Expression.Type;
var fieldType = mapperFieldExp.Expression.Type;
Check.Exception(objType != typeof(TObject) && objType != typeof(List<TObject>), ".Mapper() parameter error");
if (objType == typeof(List<TObject>))
{
objType = typeof(TObject);
}
var filedName = mapperFieldExp.Member.Name;
var fieldName = mapperFieldExp.Member.Name;
var objName = mapperObjectExp.Member.Name;
var filedEntity = this.Context.EntityMaintenance.GetEntityInfo(objType);
var objEntity = this.Context.EntityMaintenance.GetEntityInfo(filedType);
var isSelf = filedType == typeof(T);
var fieldEntity = this.Context.EntityMaintenance.GetEntityInfo(objType);
var objEntity = this.Context.EntityMaintenance.GetEntityInfo(fieldType);
var isSelf = fieldType == typeof(T);
if (Mappers == null)
Mappers = new List<Action<List<T>>>();
if (isSelf)
@@ -971,29 +971,29 @@ namespace ThingsGateway.SqlSugar
{
if (entitys.IsNullOrEmpty() || entitys.Count == 0) return;
var entity = entitys.First();
var whereCol = filedEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(filedName, StringComparison.CurrentCultureIgnoreCase));
var whereCol = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(fieldName, StringComparison.CurrentCultureIgnoreCase));
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
whereCol = fieldEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase)));
whereCol = fieldEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase)));
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id", StringComparison.CurrentCultureIgnoreCase));
whereCol = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id", StringComparison.CurrentCultureIgnoreCase));
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => (it.PropertyName).Equals(it.EntityName + "id", StringComparison.CurrentCultureIgnoreCase));
whereCol = fieldEntity.Columns.FirstOrDefault(it => (it.PropertyName).Equals(it.EntityName + "id", StringComparison.CurrentCultureIgnoreCase));
}
if (whereCol == null)
{
Check.Exception(true, ".Mapper() parameter error");
}
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(filedName).GetValue(it, null).ObjToString()).ToList();
if (inValues != null && inValues.Count != 0 && UtilMethods.GetUnderType(entitys.First().GetType().GetProperty(filedName).PropertyType) == UtilConstants.GuidType)
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(fieldName).GetValue(it, null).ObjToString()).ToList();
if (inValues != null && inValues.Count != 0 && UtilMethods.GetUnderType(entitys.First().GetType().GetProperty(fieldName).PropertyType) == UtilConstants.GuidType)
{
inValues = inValues.Select(x => string.IsNullOrEmpty(x) ? "null" : x).Distinct().ToList();
}
@@ -1010,7 +1010,7 @@ namespace ThingsGateway.SqlSugar
var list = this.Context.Queryable<TObject>().Where(wheres).ToList();
foreach (var item in entitys)
{
var whereValue = item.GetType().GetProperty(filedName).GetValue(item, null);
var whereValue = item.GetType().GetProperty(fieldName).GetValue(item, null);
var setValue = list.Where(x => x.GetType().GetProperty(whereCol.PropertyName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setObject = item.GetType().GetProperty(objName);
if (setObject.PropertyType.FullName.IsCollectionsList())
@@ -1032,7 +1032,7 @@ namespace ThingsGateway.SqlSugar
if (entitys.IsNullOrEmpty() || entitys.Count == 0) return;
var entity = entitys.First();
var tEntity = this.Context.EntityMaintenance.GetEntityInfo<T>();
var whereCol = tEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(filedName, StringComparison.CurrentCultureIgnoreCase));
var whereCol = tEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(fieldName, StringComparison.CurrentCultureIgnoreCase));
if (whereCol == null)
{
whereCol = tEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
@@ -1054,7 +1054,7 @@ namespace ThingsGateway.SqlSugar
Check.Exception(true, ".Mapper() parameter error");
}
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(whereCol.PropertyName).GetValue(it, null).ObjToString()).ToList();
var dbColumnName = filedEntity.Columns.FirstOrDefault(it => it.PropertyName == filedName).DbColumnName;
var dbColumnName = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName == fieldName).DbColumnName;
List<IConditionalModel> wheres = new List<IConditionalModel>()
{
new ConditionalModel()
@@ -1068,7 +1068,7 @@ namespace ThingsGateway.SqlSugar
foreach (var item in entitys)
{
var whereValue = item.GetType().GetProperty(whereCol.PropertyName).GetValue(item, null);
var setValue = list.Where(x => x.GetType().GetProperty(filedName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setValue = list.Where(x => x.GetType().GetProperty(fieldName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setObject = item.GetType().GetProperty(objName);
if (setObject.PropertyType.FullName.IsCollectionsList())
{
@@ -1118,18 +1118,18 @@ namespace ThingsGateway.SqlSugar
Check.Exception(mainFieldExp.Type.IsClass(), ".Mapper() parameter error");
Check.Exception(childFieldExp.Type.IsClass(), ".Mapper() parameter error");
var objType = mapperObjectExp.Type;
var filedType = mainFieldExp.Expression.Type;
var fieldType = mainFieldExp.Expression.Type;
Check.Exception(objType != typeof(TObject) && objType != typeof(List<TObject>), ".Mapper() parameter error");
if (objType == typeof(List<TObject>))
{
objType = typeof(TObject);
}
var mainFiledName = mainFieldExp.Member.Name;
var childFiledName = childFieldExp.Member.Name;
var mainFieldName = mainFieldExp.Member.Name;
var childFieldName = childFieldExp.Member.Name;
var objName = mapperObjectExp.Member.Name;
var filedEntity = this.Context.EntityMaintenance.GetEntityInfo(objType);
var objEntity = this.Context.EntityMaintenance.GetEntityInfo(filedType);
var isSelf = filedType == typeof(T);
var fieldEntity = this.Context.EntityMaintenance.GetEntityInfo(objType);
var objEntity = this.Context.EntityMaintenance.GetEntityInfo(fieldType);
var isSelf = fieldType == typeof(T);
if (Mappers == null)
Mappers = new List<Action<List<T>>>();
if (isSelf)
@@ -1138,28 +1138,28 @@ namespace ThingsGateway.SqlSugar
{
if (entitys.IsNullOrEmpty() || entitys.Count == 0) return;
var entity = entitys.First();
var whereCol = filedEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(childFiledName, StringComparison.CurrentCultureIgnoreCase));
var whereCol = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(childFieldName, StringComparison.CurrentCultureIgnoreCase));
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
whereCol = fieldEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase)));
whereCol = fieldEntity.Columns.FirstOrDefault(it => GetPrimaryKeys().Any(pk => pk.Equals(it.DbColumnName, StringComparison.CurrentCultureIgnoreCase)));
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id", StringComparison.CurrentCultureIgnoreCase));
whereCol = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals("id", StringComparison.CurrentCultureIgnoreCase));
}
if (whereCol == null)
{
whereCol = filedEntity.Columns.FirstOrDefault(it => (it.PropertyName).Equals(it.EntityName + "id", StringComparison.CurrentCultureIgnoreCase));
whereCol = fieldEntity.Columns.FirstOrDefault(it => (it.PropertyName).Equals(it.EntityName + "id", StringComparison.CurrentCultureIgnoreCase));
}
if (whereCol == null)
{
Check.Exception(true, ".Mapper() parameter error");
}
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(mainFiledName).GetValue(it, null).ObjToString()).ToList();
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(mainFieldName).GetValue(it, null).ObjToString()).ToList();
List<IConditionalModel> wheres = new List<IConditionalModel>()
{
new ConditionalModel()
@@ -1172,7 +1172,7 @@ namespace ThingsGateway.SqlSugar
var list = this.Context.Queryable<TObject>().Where(wheres).ToList();
foreach (var item in entitys)
{
var whereValue = item.GetType().GetProperty(mainFiledName).GetValue(item, null);
var whereValue = item.GetType().GetProperty(mainFieldName).GetValue(item, null);
var setValue = list.Where(x => x.GetType().GetProperty(whereCol.PropertyName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setObject = item.GetType().GetProperty(objName);
if (setObject.PropertyType.FullName.IsCollectionsList())
@@ -1194,7 +1194,7 @@ namespace ThingsGateway.SqlSugar
if (entitys.IsNullOrEmpty() || entitys.Count == 0) return;
var entity = entitys.First();
var tEntity = this.Context.EntityMaintenance.GetEntityInfo<T>();
var whereCol = tEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(childFiledName, StringComparison.CurrentCultureIgnoreCase));
var whereCol = tEntity.Columns.FirstOrDefault(it => it.PropertyName.Equals(childFieldName, StringComparison.CurrentCultureIgnoreCase));
if (whereCol == null)
{
whereCol = tEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
@@ -1216,7 +1216,7 @@ namespace ThingsGateway.SqlSugar
Check.Exception(true, ".Mapper() parameter error");
}
List<string> inValues = entitys.Select(it => it.GetType().GetProperty(whereCol.PropertyName).GetValue(it, null).ObjToString()).ToList();
var dbColumnName = filedEntity.Columns.FirstOrDefault(it => it.PropertyName == mainFiledName).DbColumnName;
var dbColumnName = fieldEntity.Columns.FirstOrDefault(it => it.PropertyName == mainFieldName).DbColumnName;
List<IConditionalModel> wheres = new List<IConditionalModel>()
{
new ConditionalModel()
@@ -1230,7 +1230,7 @@ namespace ThingsGateway.SqlSugar
foreach (var item in entitys)
{
var whereValue = item.GetType().GetProperty(whereCol.PropertyName).GetValue(item, null);
var setValue = list.Where(x => x.GetType().GetProperty(mainFiledName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setValue = list.Where(x => x.GetType().GetProperty(mainFieldName).GetValue(x, null).ObjToString() == whereValue.ObjToString()).ToList();
var setObject = item.GetType().GetProperty(objName);
if (setObject.PropertyType.FullName.IsCollectionsList())
{
@@ -1612,8 +1612,8 @@ namespace ThingsGateway.SqlSugar
result.SqlBuilder = this.SqlBuilder;
result.SqlBuilder.QueryBuilder.Parameters = QueryBuilder.Parameters;
result.SqlBuilder.QueryBuilder.SelectValue = expression;
result.SqlBuilder.QueryBuilder.IsSelectSingleFiledJson = UtilMethods.IsJsonMember(expression, this.Context);
result.SqlBuilder.QueryBuilder.IsSelectSingleFiledArray = UtilMethods.IsArrayMember(expression, this.Context);
result.SqlBuilder.QueryBuilder.IsSelectSingleFieldJson = UtilMethods.IsJsonMember(expression, this.Context);
result.SqlBuilder.QueryBuilder.IsSelectSingleFieldArray = UtilMethods.IsArrayMember(expression, this.Context);
if (this.IsCache)
{
result.WithCache(this.CacheTime);
@@ -1949,11 +1949,11 @@ namespace ThingsGateway.SqlSugar
{
result = this.Context.Utilities.DataReaderToExpandoObjectList(dataReader).Select(it => ((TResult)(object)it)).ToList();
}
else if (QueryBuilder.IsSelectSingleFiledJson)
else if (QueryBuilder.IsSelectSingleFieldJson)
{
result = this.Context.Utilities.DataReaderToSelectJsonList<TResult>(dataReader);
}
else if (QueryBuilder.IsSelectSingleFiledArray)
else if (QueryBuilder.IsSelectSingleFieldArray)
{
result = this.Context.Utilities.DataReaderToSelectArrayList<TResult>(dataReader);
}
@@ -1995,11 +1995,11 @@ namespace ThingsGateway.SqlSugar
var expObj = await Context.Utilities.DataReaderToExpandoObjectListAsync(dataReader).ConfigureAwait(false);
result = expObj.Select(it => ((TResult)(object)it)).ToList();
}
else if (QueryBuilder.IsSelectSingleFiledJson)
else if (QueryBuilder.IsSelectSingleFieldJson)
{
result = await Context.Utilities.DataReaderToSelectJsonListAsync<TResult>(dataReader).ConfigureAwait(false);
}
else if (QueryBuilder.IsSelectSingleFiledArray)
else if (QueryBuilder.IsSelectSingleFieldArray)
{
result = await Context.Utilities.DataReaderToSelectArrayListAsync<TResult>(dataReader).ConfigureAwait(false);
}

View File

@@ -474,7 +474,7 @@ namespace ThingsGateway.SqlSugar
var bEntity = this.Context.EntityMaintenance.GetEntityInfo(bType);
var bProperty = bEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true)?.PropertyName;
Check.Exception(bProperty == null, bEntity.EntityName + " no primary key");
var bDbFiled = bEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true).DbColumnName;
var bDbField = bEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true).DbColumnName;
this.Mapper((it, cache) =>
{
var list = cache.Get<Dictionary<object, List<BType>>>(oldList =>
@@ -496,7 +496,7 @@ namespace ThingsGateway.SqlSugar
cons = new List<IConditionalModel>() {
new ConditionalModel(){
ConditionalType=ConditionalType.In,
FieldName= bDbFiled,
FieldName= bDbField,
FieldValue=string.Join(",",mappingList.Select(z=>UtilMethods.GetPropertyValue(z,m_bPropertyName)).Distinct())
}
};
@@ -1139,12 +1139,12 @@ namespace ThingsGateway.SqlSugar
}
var pks = GetPrimaryKeys().Select(it => SqlBuilder.GetTranslationTableName(it)).ToList();
Check.Exception(pks == null || pks.Count != 1, "Queryable.In(params object[] pkValues): Only one primary key");
string filed = pks.FirstOrDefault();
string field = pks.FirstOrDefault();
string shortName = QueryBuilder.TableShortName == null ? null : (QueryBuilder.TableShortName + ".");
filed = shortName + filed;
return In(filed, pkValues);
field = shortName + field;
return In(field, pkValues);
}
public virtual ISugarQueryable<T> In<FieldType>(string filed, params FieldType[] inValues)
public virtual ISugarQueryable<T> In<FieldType>(string field, params FieldType[] inValues)
{
if (inValues.Length == 1)
{
@@ -1153,7 +1153,7 @@ namespace ThingsGateway.SqlSugar
var whereIndex = QueryBuilder.WhereIndex;
string parameterName = this.SqlBuilder.SqlParameterKeyWord + "InPara" + whereIndex;
this.AddParameters(new SugarParameter(parameterName, inValues[0]));
this.Where(string.Format(QueryBuilder.EqualTemplate, SqlBuilder.GetTranslationColumnName(filed), parameterName));
this.Where(string.Format(QueryBuilder.EqualTemplate, SqlBuilder.GetTranslationColumnName(field), parameterName));
QueryBuilder.WhereIndex++;
}
else
@@ -1166,7 +1166,7 @@ namespace ThingsGateway.SqlSugar
values.Add(item.ToString().ToSqlValue());
}
}
this.Where(string.Format(QueryBuilder.InTemplate, SqlBuilder.GetTranslationColumnName(filed), string.Join(",", values)));
this.Where(string.Format(QueryBuilder.InTemplate, SqlBuilder.GetTranslationColumnName(field), string.Join(",", values)));
}
}
else
@@ -1186,7 +1186,7 @@ namespace ThingsGateway.SqlSugar
}
}
}
this.Where(string.Format(QueryBuilder.InTemplate, SqlBuilder.GetTranslationColumnName(filed), string.Join(",", values)));
this.Where(string.Format(QueryBuilder.InTemplate, SqlBuilder.GetTranslationColumnName(field), string.Join(",", values)));
}
return this;
@@ -1395,15 +1395,15 @@ namespace ThingsGateway.SqlSugar
return this;
}
public virtual ISugarQueryable<T> GroupBy(string groupFileds)
public virtual ISugarQueryable<T> GroupBy(string groupFields)
{
groupFileds = groupFileds.ToCheckField();
groupFields = groupFields.ToCheckField();
var croupByValue = QueryBuilder.GroupByValue;
if (QueryBuilder.GroupByValue.IsNullOrEmpty())
{
QueryBuilder.GroupByValue = QueryBuilder.GroupByTemplate;
}
QueryBuilder.GroupByValue += string.IsNullOrEmpty(croupByValue) ? groupFileds : ("," + groupFileds);
QueryBuilder.GroupByValue += string.IsNullOrEmpty(croupByValue) ? groupFields : ("," + groupFields);
return this;
}
@@ -1415,14 +1415,14 @@ namespace ThingsGateway.SqlSugar
QueryBuilder.DisableTop = true;
return this;
}
public virtual ISugarQueryable<T> PartitionBy(string groupFileds)
public virtual ISugarQueryable<T> PartitionBy(string groupFields)
{
var partitionByValue = QueryBuilder.PartitionByValue;
if (QueryBuilder.PartitionByValue.IsNullOrEmpty())
{
QueryBuilder.PartitionByValue = QueryBuilder.PartitionByTemplate;
}
QueryBuilder.PartitionByValue += string.IsNullOrEmpty(partitionByValue) ? groupFileds : ("," + groupFileds);
QueryBuilder.PartitionByValue += string.IsNullOrEmpty(partitionByValue) ? groupFields : ("," + groupFields);
return this;
}

View File

@@ -435,9 +435,9 @@ namespace ThingsGateway.SqlSugar
QueryBuilder.DisableTop = true;
return this;
}
public new ISugarQueryable<T, T2> PartitionBy(string groupFileds)
public new ISugarQueryable<T, T2> PartitionBy(string groupFields)
{
base.PartitionBy(groupFileds);
base.PartitionBy(groupFields);
return this;
}
public new virtual ISugarQueryable<T, T2> GroupByIF(bool isGroupBy, Expression<Func<T, object>> expression)
@@ -1010,9 +1010,9 @@ namespace ThingsGateway.SqlSugar
QueryBuilder.DisableTop = true;
return this;
}
public new ISugarQueryable<T, T2, T3> PartitionBy(string groupFileds)
public new ISugarQueryable<T, T2, T3> PartitionBy(string groupFields)
{
base.PartitionBy(groupFileds);
base.PartitionBy(groupFields);
return this;
}
public new virtual ISugarQueryable<T, T2, T3> GroupByIF(bool isGroupBy, Expression<Func<T, object>> expression)

View File

@@ -27,7 +27,7 @@ namespace ThingsGateway.SqlSugar
set { _WhereInfos = value; }
}
public virtual List<object> BigDataInValues { get; set; }
public virtual string BigDataFiled { get; set; }
public virtual string BigDataField { get; set; }
#endregion
#region Sql Template
@@ -136,7 +136,7 @@ namespace ThingsGateway.SqlSugar
while (pageCount >= pageIndex)
{
var inValues = this.BigDataInValues.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
batchDeleteSql.Append(sql + string.Format(WhereInTemplate, BigDataFiled, inValues.ToArray().ToJoinSqlInVals()));
batchDeleteSql.Append(sql + string.Format(WhereInTemplate, BigDataField, inValues.ToArray().ToJoinSqlInVals()));
batchDeleteSql.Append(';');
pageIndex++;
}

View File

@@ -13,7 +13,7 @@ namespace ThingsGateway.SqlSugar
this.Parameters = new List<SugarParameter>();
}
#region Private Fileds
#region Private Fields
protected List<JoinQueryInfo> _JoinQueryInfos;
protected Dictionary<string, string> _EasyJoinInfos;
private List<string> _WhereInfos;
@@ -42,8 +42,8 @@ namespace ThingsGateway.SqlSugar
internal List<List<QueryableAppendColumn>> AppendValues { get; set; }
public bool IsCrossQueryWithAttr { get; set; }
public Dictionary<string, string> CrossQueryItems { get; set; }
public bool IsSelectSingleFiledJson { get; set; }
public bool IsSelectSingleFiledArray { get; set; }
public bool IsSelectSingleFieldJson { get; set; }
public bool IsSelectSingleFieldArray { get; set; }
public string TranLock { get; set; }
public bool IsDisableMasterSlaveSeparation { get; set; }
public bool IsEnableMasterSlaveSeparation { get; set; }

View File

@@ -54,12 +54,7 @@ namespace ThingsGateway.SqlSugar
#endregion
#region Util Methods
[Obsolete("Use SqlSugarClient.Utilities")]
public virtual IContextMethods RewritableMethods
{
get { return this.Context.Utilities; }
set { this.Context.Utilities = value; }
}
public virtual IContextMethods Utilities
{
get
@@ -1376,16 +1371,7 @@ namespace ThingsGateway.SqlSugar
Check.ExceptionEasy(" var childDb=Db.GetConnection(configId); use Db.CreateContext ", " 例如 var childDb=Db.GetConnection(configId);其中Db才能使用CreateContextchildDb不能使用");
return null;
}
//[Obsolete("Use SqlSugarClient.GetSimpleClient() Or SqlSugarClient.GetSimpleClient<T>() ")]
//public virtual SimpleClient SimpleClient
//{
// get
// {
// if (this._SimpleClient == null)
// this._SimpleClient = new SimpleClient(this);
// return this._SimpleClient;
// }
//}
public virtual SimpleClient<T> GetSimpleClient<T>() where T : class, new()
{
return new SimpleClient<T>(this);

View File

@@ -445,7 +445,7 @@ namespace ThingsGateway.SqlSugar
}
return this;
}
public IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> filedNameExpression, string computationalSymbol)
public IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> fieldNameExpression, string computationalSymbol)
{
if (UpdateParameterIsNull == true)
{
@@ -453,10 +453,10 @@ namespace ThingsGateway.SqlSugar
}
else
{
var name = ExpressionTool.GetMemberName(filedNameExpression);
var name = ExpressionTool.GetMemberName(fieldNameExpression);
if (name == null)
{
Check.ExceptionEasy(filedNameExpression + " format error ", filedNameExpression + "参数格式错误");
Check.ExceptionEasy(fieldNameExpression + " format error ", fieldNameExpression + "参数格式错误");
}
//var value = this.UpdateBuilder.GetExpressionValue(ValueExpExpression, ResolveExpressType.WhereSingle).GetResultString();
if (this.UpdateBuilder.ReSetValueBySqlExpList == null)
@@ -476,18 +476,18 @@ namespace ThingsGateway.SqlSugar
return this;
}
public IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> filedNameExpression, Expression<Func<T, object>> ValueExpExpression)
public IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> fieldNameExpression, Expression<Func<T, object>> ValueExpExpression)
{
if (UpdateParameterIsNull == true)
{
return SetColumns(filedNameExpression, ValueExpExpression);
return SetColumns(fieldNameExpression, ValueExpExpression);
}
else
{
var name = ExpressionTool.GetMemberName(filedNameExpression);
var name = ExpressionTool.GetMemberName(fieldNameExpression);
if (name == null)
{
Check.ExceptionEasy(filedNameExpression + " format error ", filedNameExpression + "参数格式错误");
Check.ExceptionEasy(fieldNameExpression + " format error ", fieldNameExpression + "参数格式错误");
}
var value = this.UpdateBuilder.GetExpressionValue(ValueExpExpression, ResolveExpressType.WhereSingle).GetResultString();
if (this.UpdateBuilder.ReSetValueBySqlExpList == null)
@@ -712,24 +712,24 @@ namespace ThingsGateway.SqlSugar
AppendSets();
return this;
}
public IUpdateable<T> SetColumnsIF(bool isUpdateColumns, Expression<Func<T, object>> filedNameExpression, object fieldValue)
public IUpdateable<T> SetColumnsIF(bool isUpdateColumns, Expression<Func<T, object>> fieldNameExpression, object fieldValue)
{
if (isUpdateColumns)
{
return SetColumns(filedNameExpression, fieldValue);
return SetColumns(fieldNameExpression, fieldValue);
}
else
{
return this;
}
}
public virtual IUpdateable<T> SetColumns(Expression<Func<T, object>> filedNameExpression, Expression<Func<T, object>> valueExpression)
public virtual IUpdateable<T> SetColumns(Expression<Func<T, object>> fieldNameExpression, Expression<Func<T, object>> valueExpression)
{
if (valueExpression == null)
{
return SetColumns(filedNameExpression, (object)null);
return SetColumns(fieldNameExpression, (object)null);
}
var name = UpdateBuilder.GetExpressionValue(filedNameExpression, ResolveExpressType.FieldSingle).GetString();
var name = UpdateBuilder.GetExpressionValue(fieldNameExpression, ResolveExpressType.FieldSingle).GetString();
name = UpdateBuilder.Builder.GetTranslationColumnName(name);
var exp = ExpressionTool.RemoveConvert((valueExpression as LambdaExpression).Body);
var value = UpdateBuilder.GetExpressionValue(exp, ResolveExpressType.WhereSingle).GetString();
@@ -749,9 +749,9 @@ namespace ThingsGateway.SqlSugar
}
return this;
}
public virtual IUpdateable<T> SetColumns(Expression<Func<T, object>> filedNameExpression, object fieldValue)
public virtual IUpdateable<T> SetColumns(Expression<Func<T, object>> fieldNameExpression, object fieldValue)
{
var name = UpdateBuilder.GetExpressionValue(filedNameExpression, ResolveExpressType.FieldSingle).GetString();
var name = UpdateBuilder.GetExpressionValue(fieldNameExpression, ResolveExpressType.FieldSingle).GetString();
name = UpdateBuilder.Builder.GetNoTranslationColumnName(name);
return SetColumns(name, fieldValue);
}

View File

@@ -11,7 +11,7 @@
public bool IsDisabledDelete { get; set; }
public bool IsDisabledUpdateAll { get; set; }
public List<SugarIndexAttribute> Indexs { get; set; }
public bool IsCreateTableFiledSort { get; set; }
public bool IsCreateTableFieldSort { get; set; }
public string Discrimator { get; set; }
}
}

View File

@@ -8,7 +8,7 @@
public string TableDescription { get; set; }
public bool IsDisabledDelete { get; set; }
public bool IsDisabledUpdateAll { get; set; }
public bool IsCreateTableFiledSort { get; set; }
public bool IsCreateTableFieldSort { get; set; }
public string Discrimator { get; set; }
public SugarTable(string tableName)
{
@@ -31,7 +31,7 @@
this.TableName = tableName;
this.TableDescription = tableDescription;
this.IsDisabledDelete = isDisabledDelete;
this.IsCreateTableFiledSort = isCreateTableFieldSort;
this.IsCreateTableFieldSort = isCreateTableFieldSort;
}
}
[AttributeUsage(AttributeTargets.Property, Inherited = true)]

View File

@@ -585,7 +585,7 @@ namespace ThingsGateway.SqlSugar
}
else if (isField)
{
reval = GetFiledValue(memberExpr);
reval = GetFieldValue(memberExpr);
}
}
if (memberExpr.Expression == null)
@@ -706,7 +706,7 @@ namespace ThingsGateway.SqlSugar
}
}
public static object GetFiledValue(MemberExpression memberExpr)
public static object GetFieldValue(MemberExpression memberExpr)
{
if (!(memberExpr.Member is FieldInfo))
{

View File

@@ -91,7 +91,7 @@ namespace ThingsGateway.SqlSugar
throw new NotSupportedException("Can only be used in expressions");
}
public static int RowCount(object countFiledName, object orderByField, object partitionBy)
public static int RowCount(object countFieldName, object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
@@ -99,35 +99,35 @@ namespace ThingsGateway.SqlSugar
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowSum<TRestult>(TRestult filedName)
public static TRestult RowSum<TRestult>(TRestult fieldName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowSum<TRestult>(TRestult filedName, object orderByField, object partitionBy)
public static TRestult RowSum<TRestult>(TRestult fieldName, object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMax<TRestult>(TRestult filedName)
public static TRestult RowMax<TRestult>(TRestult fieldName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMax<TRestult>(TRestult filedNameobject, object orderByField, object partitionBy)
public static TRestult RowMax<TRestult>(TRestult fieldNameobject, object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMin<TRestult>(TRestult filedName)
public static TRestult RowMin<TRestult>(TRestult fieldName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMin<TRestult>(TRestult filedName, object orderByField, object partitionBy)
public static TRestult RowMin<TRestult>(TRestult fieldName, object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowAvg<TRestult>(TRestult filedName)
public static TRestult RowAvg<TRestult>(TRestult fieldName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowAvg<TRestult>(TRestult filedName, object orderByField, object partitionBy)
public static TRestult RowAvg<TRestult>(TRestult fieldName, object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
@@ -387,9 +387,9 @@ namespace ThingsGateway.SqlSugar
/// <returns></returns>
public static Subqueryable<T> Subqueryable<T>() where T : class, new() { throw new NotSupportedException("Can only be used in expressions"); }
public static CaseThen IF(bool condition) { throw new NotSupportedException("Can only be used in expressions"); }
[Obsolete("多库下参数顺序不一至,为了保证多库下更好体验请使用 SqlFunc.CharIndexNew")]
public static int CharIndex(string findChar, string searchValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int CharIndexNew(string stringValue, string charValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int BitwiseAnd(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
public static int BitwiseInclusiveOR(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
public static int BitwiseAnd(long left, long right) { throw new NotSupportedException("Can only be used in expressions"); }

View File

@@ -208,12 +208,12 @@ namespace ThingsGateway.SqlSugar
var fieldName = entity.Columns.First(it => it.PropertyName == name).DbColumnName;
var array = (field as MemberExpression).ToString().Split('.').ToList();
array[array.Count - 1] = fieldName;
var filedString = string.Join(".", array);
var fieldString = string.Join(".", array);
return new MapperExpressionInfo()
{
Type = type,
FieldName = fieldName,
FieldString = filedString,
FieldString = fieldString,
EntityInfo = entity
};
}
@@ -303,7 +303,7 @@ namespace ThingsGateway.SqlSugar
var fieldName = entity.Columns.First(it => it.PropertyName == name).DbColumnName;
//var array = (field as MemberExpression).ToString().Split('.').ToList();
//array[array.Count() - 1] = fieldName;
//var filedString = string.Join(".", array);
//var fieldString = string.Join(".", array);
return new MapperExpressionInfo()
{
Type = type,

View File

@@ -47,7 +47,7 @@ namespace ThingsGateway.SqlSugar
object value = null;
if (isField)
{
value = ExpressionTool.GetFiledValue(expression);
value = ExpressionTool.GetFieldValue(expression);
}
else if (isProperty)
{

View File

@@ -15,7 +15,7 @@ namespace ThingsGateway.SqlSugar
case ResolveExpressType.SelectMultiple:
case ResolveExpressType.FieldSingle:
case ResolveExpressType.FieldMultiple:
#region Filed
#region Field
try
{
var value = ExpressionTool.DynamicInvoke(expression);

View File

@@ -124,13 +124,13 @@ namespace ThingsGateway.SqlSugar
ISugarQueryable<T> GroupBy(Expression<Func<T, object>> expression);
ISugarQueryable<T> GroupBy(string groupFileds);
ISugarQueryable<T> GroupBy(string groupFields);
ISugarQueryable<T> GroupByIF(bool isGroupBy, Expression<Func<T, object>> expression);
ISugarQueryable<T> GroupByIF(bool isGroupBy, string groupFields);
ISugarQueryable<T> PartitionBy(Expression<Func<T, object>> expression);
ISugarQueryable<T> PartitionBy(string groupFileds);
ISugarQueryable<T> PartitionBy(string groupFields);
ISugarQueryable<T> Skip(int index);
ISugarQueryable<T> Take(int num);
@@ -213,10 +213,10 @@ namespace ThingsGateway.SqlSugar
//bool IntoTable(Type TableEntityType, params string[] columnNameList);
//bool IntoTable<TableEntityType>(params string[] columnNameList);
List<T> SetContext<ParameterT>(Expression<Func<T, bool>> whereExpression, ParameterT parameter);
List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisFiled, Expression<Func<object>> mappingFiled, ParameterT parameter);
List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisFiled1, Expression<Func<object>> mappingFiled1, Expression<Func<T, object>> thisFiled2, Expression<Func<object>> mappingFiled2, ParameterT parameter);
Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisFiled, Expression<Func<object>> mappingFiled, ParameterT parameter);
Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisFiled1, Expression<Func<object>> mappingFiled1, Expression<Func<T, object>> thisFiled2, Expression<Func<object>> mappingFiled2, ParameterT parameter);
List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisField, Expression<Func<object>> mappingField, ParameterT parameter);
List<T> SetContext<ParameterT>(Expression<Func<T, object>> thisField1, Expression<Func<object>> mappingField1, Expression<Func<T, object>> thisField2, Expression<Func<object>> mappingField2, ParameterT parameter);
Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisField, Expression<Func<object>> mappingField, ParameterT parameter);
Task<List<T>> SetContextAsync<ParameterT>(Expression<Func<T, object>> thisField1, Expression<Func<object>> mappingField1, Expression<Func<T, object>> thisField2, Expression<Func<object>> mappingField2, ParameterT parameter);
Dictionary<string, ValueType> ToDictionary<ValueType>(Expression<Func<T, object>> key, Expression<Func<T, object>> value);
Dictionary<string, object> ToDictionary(Expression<Func<T, object>> key, Expression<Func<T, object>> value);
Task<Dictionary<string, object>> ToDictionaryAsync(Expression<Func<T, object>> key, Expression<Func<T, object>> value);
@@ -410,7 +410,7 @@ namespace ThingsGateway.SqlSugar
#region GroupBy
new ISugarQueryable<T, T2> PartitionBy(Expression<Func<T, object>> expression);
ISugarQueryable<T, T2> PartitionBy(Expression<Func<T, T2, object>> expression);
new ISugarQueryable<T, T2> PartitionBy(string groupFileds);
new ISugarQueryable<T, T2> PartitionBy(string groupFields);
new ISugarQueryable<T, T2> GroupBy(Expression<Func<T, object>> expression);
ISugarQueryable<T, T2> GroupBy(Expression<Func<T, T2, object>> expression);
new ISugarQueryable<T, T2> GroupByIF(bool isGroupBy, Expression<Func<T, object>> expression);
@@ -555,7 +555,7 @@ namespace ThingsGateway.SqlSugar
new ISugarQueryable<T, T2, T3> PartitionBy(Expression<Func<T, object>> expression);
ISugarQueryable<T, T2, T3> PartitionBy(Expression<Func<T, T2, object>> expression);
ISugarQueryable<T, T2, T3> PartitionBy(Expression<Func<T, T2, T3, object>> expression);
new ISugarQueryable<T, T2, T3> PartitionBy(string groupFileds);
new ISugarQueryable<T, T2, T3> PartitionBy(string groupFields);
new ISugarQueryable<T, T2, T3> GroupBy(Expression<Func<T, object>> expression);
ISugarQueryable<T, T2, T3> GroupBy(Expression<Func<T, T2, object>> expression);
ISugarQueryable<T, T2, T3> GroupBy(Expression<Func<T, T2, T3, object>> expression);

View File

@@ -152,11 +152,6 @@ namespace ThingsGateway.SqlSugar
IStorageable<T> Storageable<T>(List<T> dataList) where T : class, new();
IStorageable<T> Storageable<T>(T data) where T : class, new();
StorageableDataTable Storageable(DataTable data);
[Obsolete("use Storageable")]
ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new();
[Obsolete("use Storageable")]
ISaveable<T> Saveable<T>(T saveObject) where T : class, new();
StorageableMethodInfo StorageableByObject(object singleEntityObjectOrListObject);
#endregion

View File

@@ -6,8 +6,6 @@ namespace ThingsGateway.SqlSugar
{
ISubInsertable<T> AddSubList(Expression<Func<T, object>> items);
ISubInsertable<T> AddSubList(Expression<Func<T, SubInsertTree>> tree);
[Obsolete("use ExecuteCommand")]
object ExecuteReturnPrimaryKey();
object ExecuteCommand();
Task<object> ExecuteCommandAsync();
}

View File

@@ -67,9 +67,9 @@ namespace ThingsGateway.SqlSugar
IUpdateable<T> SetColumns(Expression<Func<T, T>> columns, bool appendColumnsByDataFilter);
IUpdateable<T> SetColumns(string fieldName, object fieldValue);
IUpdateable<T> SetColumns(Expression<Func<T, object>> filedNameExpression, object fieldValue);
IUpdateable<T> SetColumns(Expression<Func<T, object>> filedNameExpression, Expression<Func<T, object>> valueExpression);
IUpdateable<T> SetColumnsIF(bool isUpdateColumns, Expression<Func<T, object>> filedNameExpression, object fieldValue);
IUpdateable<T> SetColumns(Expression<Func<T, object>> fieldNameExpression, object fieldValue);
IUpdateable<T> SetColumns(Expression<Func<T, object>> fieldNameExpression, Expression<Func<T, object>> valueExpression);
IUpdateable<T> SetColumnsIF(bool isUpdateColumns, Expression<Func<T, object>> fieldNameExpression, object fieldValue);
IUpdateable<T> UpdateColumnsIF(bool isUpdateColumns, Expression<Func<T, object>> columns);
IUpdateable<T> UpdateColumnsIF(bool isUpdateColumns, params string[] columns);
@@ -91,8 +91,8 @@ namespace ThingsGateway.SqlSugar
IUpdateable<T> EnableDiffLogEvent(object businessData = null);
IUpdateable<T> EnableDiffLogEventIF(bool isEnableDiffLog, object businessData = null);
IUpdateable<T> ReSetValue(Action<T> setValueExpression);
IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> filedNameExpression, string computationalSymbol);
IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> filedNameExpression, Expression<Func<T, object>> ValueExpExpression);
IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> fieldNameExpression, string computationalSymbol);
IUpdateable<T> PublicSetColumns(Expression<Func<T, object>> fieldNameExpression, Expression<Func<T, object>> ValueExpExpression);
IUpdateable<T> RemoveDataCache();
IUpdateable<T> RemoveDataCache(string likeString);
IUpdateable<T> CallEntityMethod(Expression<Action<T>> method);

View File

@@ -4,9 +4,6 @@
{
public object FieldName { get; set; }
[Obsolete("名字拼错使用FieldName")]
public object FiledName { get { return FieldName; } set { FieldName = value; } }
public string AsName { get; set; }
public static List<SelectModel> Create(params SelectModel[] SelectModels)

View File

@@ -14,7 +14,7 @@ namespace ThingsGateway.SqlSugar
var orderByModel = item as SelectModel;
orderByModel.AsName = GetAsName(orderByModel);
orderByModel.FieldName = GetSqlPart(orderByModel.FieldName, pars).ObjToString();
AppendFiledName(sql, orderByModel);
AppendFieldName(sql, orderByModel);
}
else
{
@@ -46,7 +46,7 @@ namespace ThingsGateway.SqlSugar
return this.SqlTranslationLeft + orderByModel.AsName + this.SqlTranslationRight;
}
private void AppendFiledName(StringBuilder sql, SelectModel orderByModel)
private void AppendFieldName(StringBuilder sql, SelectModel orderByModel)
{
sql.Append($" {orderByModel.FieldName} AS {orderByModel.AsName} ,");
}

View File

@@ -10,7 +10,7 @@ namespace ThingsGateway.SqlSugar
#region Root
private string GetSqlPart(object value, List<SugarParameter> pars)
{
Check.Exception(value == null, $" FiledName is error ");
Check.Exception(value == null, $" FieldName is error ");
if (IsSqlSplicingOperator(value))
{
return GetSqlSplicingOperator(value);

View File

@@ -58,20 +58,20 @@ namespace ThingsGateway.SqlSugar
&& it.Columns.Any(z => z.Name.EqualCase(columnName)));
}
private string GetColumnName(string filedName)
private string GetColumnName(string fieldName)
{
return filedName.Split('.').Last();
return fieldName.Split('.').Last();
}
private string GetTableName(string filedName)
private string GetTableName(string fieldName)
{
if (!filedName.Contains('.'))
if (!fieldName.Contains('.'))
{
return TableInfos.First(it => it.IsMaster).Table;
}
else
{
var shortName = filedName.Split('.').First();
var shortName = fieldName.Split('.').First();
return TableInfos.First(it => it.ShortName == shortName).Table;
}
}

View File

@@ -14,7 +14,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();

View File

@@ -556,7 +556,7 @@ WHERE table_name = '" + tableName + "'");
return comments.HasValue() ? comments.First() : "";
}
public string GetFieldComment(string tableName, string filedName)
public string GetFieldComment(string tableName, string fieldName)
{
string cacheKey = "DbMaintenanceProvider.GetFieldComment." + tableName;
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
@@ -571,7 +571,7 @@ WHERE table_name = '" + tableName + "'");
});
if (comments.HasValue())
{
var comment = comments.FirstOrDefault(it => it.DbColumnName.Equals(filedName, StringComparison.CurrentCultureIgnoreCase));
var comment = comments.FirstOrDefault(it => it.DbColumnName.Equals(fieldName, StringComparison.CurrentCultureIgnoreCase));
return comment?.ColumnDescription;
}
else

View File

@@ -7,9 +7,9 @@
return this;
}
//public override ISugarQueryable<T> PartitionBy(string groupFileds)
//public override ISugarQueryable<T> PartitionBy(string groupFields)
//{
// this.GroupBy(groupFileds);
// this.GroupBy(groupFields);
// return this;
//}
}

View File

@@ -14,7 +14,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}

View File

@@ -7,7 +7,7 @@
return this;
}
//public override ISugarQueryable<T> PartitionBy(string groupFileds)
//public override ISugarQueryable<T> PartitionBy(string groupFields)
//{
// this.QueryBuilder.
// return this;

View File

@@ -20,7 +20,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();

View File

@@ -19,9 +19,9 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
this.GroupBy(groupFileds);
this.GroupBy(groupFields);
return this;
}
}

View File

@@ -583,7 +583,7 @@ WHERE table_name = '" + tableName + "'");
return comments.HasValue() ? comments.First() : "";
}
public string GetFieldComment(string tableName, string filedName)
public string GetFieldComment(string tableName, string fieldName)
{
string cacheKey = "DbMaintenanceProvider.GetFieldComment." + tableName;
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
@@ -596,7 +596,7 @@ WHERE table_name = '" + tableName + "'");
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
return pks;
});
return comments.HasValue() ? comments.FirstOrDefault(it => it.DbColumnName.EqualCase(filedName))?.ColumnDescription : "";
return comments.HasValue() ? comments.FirstOrDefault(it => it.DbColumnName.EqualCase(fieldName))?.ColumnDescription : "";
}

View File

@@ -14,7 +14,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}

View File

@@ -7,9 +7,9 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
this.GroupBy(groupFileds);
this.GroupBy(groupFields);
return this;
}
}

View File

@@ -24,7 +24,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}

View File

@@ -7,9 +7,9 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
this.GroupBy(groupFileds);
this.GroupBy(groupFields);
return this;
}
}

View File

@@ -26,7 +26,7 @@ namespace ThingsGateway.SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}

View File

@@ -7,13 +7,13 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
if (this.QueryBuilder.Take == 1)
{
this.QueryBuilder.Take = null;
}
this.QueryBuilder.PartitionByValue = groupFileds;
this.QueryBuilder.PartitionByValue = groupFields;
return this;
}
}

View File

@@ -123,7 +123,7 @@
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
if (entityInfo.IsCreateTableFieldSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();

View File

@@ -7,9 +7,9 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
this.GroupBy(groupFileds);
this.GroupBy(groupFields);
return this;
}
}

View File

@@ -580,16 +580,6 @@ namespace ThingsGateway.SqlSugar
return this.Context.Storageable(new List<T> { data });
}
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
{
return this.Context.Saveable<T>(saveObjects);
}
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
{
return this.Context.Saveable(saveObject);
}
public StorageableMethodInfo StorageableByObject(object singleEntityObjectOrListObject)
{
return this.Context.StorageableByObject(singleEntityObjectOrListObject);

View File

@@ -499,17 +499,6 @@ namespace ThingsGateway.SqlSugar
return ScopedContext.RollbackTranAsync();
}
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
{
return ScopedContext.Saveable(saveObjects);
}
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
{
return ScopedContext.Saveable(saveObject);
}
public int SaveQueues(bool isTran = true)
{
return ScopedContext.SaveQueues(isTran);

View File

@@ -1812,11 +1812,6 @@ namespace ThingsGateway.SqlSugar
}
}
[Obsolete("请使用新名字FieldNameSql")]
public static string FiledNameSql()
{
return $"[value=sql{UtilConstants.ReplaceKey}]";
}
public static string FieldNameSql()
{
if (StaticConfig.TableQuerySqlKey != Guid.Empty)

View File

@@ -7,9 +7,9 @@
return this;
}
public override ISugarQueryable<T> PartitionBy(string groupFileds)
public override ISugarQueryable<T> PartitionBy(string groupFields)
{
this.GroupBy(groupFileds);
this.GroupBy(groupFields);
return this;
}
}

View File

@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<PluginVersion>10.8.23</PluginVersion>
<ProPluginVersion>10.8.23</ProPluginVersion>
<PluginVersion>10.8.24</PluginVersion>
<ProPluginVersion>10.8.24</ProPluginVersion>
<AuthenticationVersion>2.8.4</AuthenticationVersion>
<SourceGeneratorVersion>10.8.6</SourceGeneratorVersion>
<NET8Version>8.0.17</NET8Version>

View File

@@ -335,7 +335,7 @@ public abstract class DeviceBase : DisposableObject, IDevice
return EasyTask.CompletedTask;
}
protected volatile bool AutoConnect = true;
public bool AutoConnect { get; protected set; } = true;
/// <inheritdoc/>
private async ValueTask<OperResult> SendAsync(ISendMessage sendMessage, IClientChannel channel = default, EndPoint endPoint = default, CancellationToken token = default)
{
@@ -372,8 +372,7 @@ public abstract class DeviceBase : DisposableObject, IDevice
SetDataAdapter(channel);
try
{
if (AutoConnect && !Channel.Online)
await Channel.ConnectAsync(Channel.ChannelOptions.ConnectTimeout, token).ConfigureAwait(false);
await ConnectAsync(token).ConfigureAwait(false);
}
catch (Exception)
{
@@ -387,6 +386,30 @@ public abstract class DeviceBase : DisposableObject, IDevice
}
private WaitLock connectWaitLock = new();
public async Task ConnectAsync(CancellationToken token)
{
if (AutoConnect && Channel != null && Channel?.Online != true)
{
try
{
await connectWaitLock.WaitAsync(token).ConfigureAwait(false);
if (AutoConnect && Channel != null && Channel?.Online != true)
{
await Channel.CloseAsync().ConfigureAwait(false);
await Task.Delay(500, token).ConfigureAwait(false);
await Channel.ConnectAsync(Channel.ChannelOptions.ConnectTimeout, token).ConfigureAwait(false);
}
}
finally
{
await Task.Delay(500, token).ConfigureAwait(false);
connectWaitLock.Release();
}
}
}
/// <inheritdoc/>
public virtual async ValueTask<OperResult> SendAsync(ISendMessage sendMessage, CancellationToken cancellationToken)
{
@@ -553,7 +576,7 @@ public abstract class DeviceBase : DisposableObject, IDevice
}
else
{
throw new(result.ErrorMessage ?? "unknown error");
return new MessageBase(result);
}
}

View File

@@ -112,7 +112,7 @@ public static partial class DeviceExtension
int index = variable.Index;
try
{
var changed = byteConverter.GetChangedDataFormBytes(device, variable.RegisterAddress, buffer, index, dataType, variable.ArrayLength ?? 1, variable.Value, out var data);
var changed = byteConverter.GetChangedDataFormBytes(device, variable.RegisterAddress, buffer, index, dataType, variable.ArrayLength ?? 1, variable.RawValue, out var data);
if (changed)
{
result = variable.SetValue(data, time);

View File

@@ -15,7 +15,7 @@ namespace ThingsGateway.Foundation;
/// <summary>
/// 协议设备接口
/// </summary>
public interface IDevice : IDisposable
public interface IDevice : IDisposable, IDisposableObject
{
#region
@@ -61,6 +61,7 @@ public interface IDevice : IDisposable
/// 字符串翻转
/// </summary>
bool IsStringReverseByteWord { get; set; }
bool AutoConnect { get; }
#endregion
@@ -467,4 +468,5 @@ public interface IDevice : IDisposable
/// <param name="deviceLog">单独设备日志</param>
void InitChannel(IChannel channel, ILog? deviceLog = null);
ValueTask<OperResult<byte[]>> ReadAsync(object state, CancellationToken cancellationToken = default);
Task ConnectAsync(CancellationToken token);
}

View File

@@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="$(NET9Version)" />
<PackageReference Include="TouchSocket" Version="3.1.10" />
<PackageReference Include="TouchSocket.SerialPorts" Version="3.1.10" />
<PackageReference Include="TouchSocket" Version="3.1.11" />
<PackageReference Include="TouchSocket.SerialPorts" Version="3.1.11" />
</ItemGroup>
<ItemGroup>

View File

@@ -54,6 +54,7 @@ public interface IVariable
/// 打包变量
/// </summary>
IVariableSource VariableSource { get; set; }
object? RawValue { get; }
void SetNoChangedValue(DateTime dateTime);

View File

@@ -61,9 +61,11 @@ public class VariableClass : IVariable
/// IVariableSource
/// </summary>
public IVariableSource VariableSource { get; set; }
public object? RawValue { get; private set; }
public void SetNoChangedValue(DateTime dateTime)
{
SetValue(RawValue, dateTime, true);
}
/// <summary>
@@ -76,6 +78,7 @@ public class VariableClass : IVariable
public virtual OperResult SetValue(object? value, DateTime dateTime = default, bool isOnline = true)
{
IsOnline = isOnline;
RawValue = value;
_value = value;
return new();
}

View File

@@ -58,8 +58,11 @@ public abstract class CollectFoundationBase : CollectBase
/// <returns></returns>
protected override async Task ProtectedStartAsync(CancellationToken cancellationToken)
{
if (FoundationDevice?.Channel != null)
await FoundationDevice.Channel.ConnectAsync(FoundationDevice.Channel.ChannelOptions.ConnectTimeout, cancellationToken).ConfigureAwait(false);
if (FoundationDevice != null)
{
await FoundationDevice.ConnectAsync(cancellationToken).ConfigureAwait(false);
}
}
public override string GetAddressDescription()
@@ -72,16 +75,28 @@ public abstract class CollectFoundationBase : CollectBase
{
if (FoundationDevice != null)
{
if (FoundationDevice.OnLine == false)
if (!FoundationDevice.OnLine)
{
if (!FoundationDevice.DisposedValue || FoundationDevice.Channel?.DisposedValue != false) return;
Exception exception = null;
try
{
if (!cancellationToken.IsCancellationRequested)
{
await FoundationDevice.Channel.ConnectAsync(FoundationDevice.Channel.ChannelOptions.ConnectTimeout, cancellationToken).ConfigureAwait(false);
if (!FoundationDevice.DisposedValue || FoundationDevice.Channel?.DisposedValue != false) return;
await FoundationDevice.ConnectAsync(cancellationToken).ConfigureAwait(false);
if (CurrentDevice.DeviceStatusChangeTime < TimerX.Now.AddMinutes(-1))
{
await Task.Delay(30000, cancellationToken).ConfigureAwait(false);
}
}
}
catch (OperationCanceledException)
{
}
catch (Exception ex)
{
exception = ex;

View File

@@ -67,6 +67,11 @@ public class DeviceRuntime : Device, IDisposable
[AutoGenerateColumn(Ignore = true)]
public string LogPath => Name.GetDeviceLogPath();
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
[AdaptIgnore]
public DateTime DeviceStatusChangeTime = DateTime.UnixEpoch.ToLocalTime();
/// <summary>
/// 设备状态
/// </summary>
@@ -86,6 +91,7 @@ public class DeviceRuntime : Device, IDisposable
if (_deviceStatus != value)
{
_deviceStatus = value;
DeviceStatusChangeTime = TimerX.Now;
GlobalData.DeviceStatusChange(this);
}
}

View File

@@ -109,8 +109,15 @@ public partial class VariableRuntime : Variable, IVariable, IDisposable
public void SetNoChangedValue(DateTime dateTime)
{
DateTime time = dateTime != default ? dateTime : DateTime.Now;
CollectTime = time;
GlobalData.VariableCollectChange(this);
if (!IsOnline)
{
SetValue(RawValue, time, true);
}
else
{
CollectTime = time;
GlobalData.VariableCollectChange(this);
}
}
private void Set(object data, DateTime dateTime)

View File

@@ -8,8 +8,8 @@
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="Rougamo.Fody" Version="5.0.1" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.10" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.10" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.11" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.11" />
<PackageReference Include="ThingsGateway.Authentication" Version="$(AuthenticationVersion)" />
<!--<ProjectReference Include="..\..\PluginPro\ThingsGateway.Authentication\ThingsGateway.Authentication.csproj" />-->

View File

@@ -15,10 +15,10 @@
<EditorItem @bind-Field="@context.DecimalPlaces" GroupName=@(ValueTransformConfigLocalizer["TransformType"]) Cols="4" />
<EditorItem @bind-Field="@context.RawMin" GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.RawMax" GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.ActualMin" GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.ActualMax" GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.RawMin" Readonly=@(context.TransformType != ValueTransformType.Linear) GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.RawMax" Readonly=@(context.TransformType != ValueTransformType.Linear) GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.ActualMin" Readonly=@(context.ClampToRawRange == false && context.TransformType != ValueTransformType.Linear) GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
<EditorItem @bind-Field="@context.ActualMax" Readonly=@(context.ClampToRawRange == false && context.TransformType != ValueTransformType.Linear) GroupName=@(ValueTransformConfigLocalizer["MinMax"]) GroupOrder=2 Cols="6" />
</FieldItems>

View File

@@ -10,7 +10,6 @@
using Microsoft.AspNetCore.Components.Forms;
using System.Globalization;
using System.Text.RegularExpressions;
using ThingsGateway.NewLife.Extension;
@@ -66,7 +65,7 @@ public partial class ValueTransformConfigPage
// Linear + clamp actual
m = Regex.Match(formula, $@"^Math\.Round\(\s*
m = Regex.Match(formula, $@"^Math\.Round\(\s*
Math\.Min\(\s*
Math\.Max\(\s*
\(\(raw\.ToDecimal\(\)\s*-\s*({dec})\)\s*/\s*

View File

@@ -435,19 +435,17 @@ public partial class SiemensS7Master : DeviceBase
var result2 = await SendThenReturnMessageBaseAsync(new S7Send(ISO_CR), channel).ConfigureAwait(false);
if (!result2.IsSuccess)
{
if (result2.Exception is OperationCanceledException)
return true;
Logger?.LogWarning(string.Format(AppResource.HandshakeError1, channel.ToString(), result2));
await channel.CloseAsync().ConfigureAwait(false);
if (result2.Exception is not OperationCanceledException)
Logger?.LogWarning(string.Format(AppResource.HandshakeError1, channel.ToString(), result2));
return true;
}
}
catch (OperationCanceledException) { }
catch (Exception ex)
{
Logger?.LogWarning(string.Format(AppResource.HandshakeError1, channel.ToString(), ex));
await channel.CloseAsync().ConfigureAwait(false);
if (ex is not OperationCanceledException)
Logger?.LogWarning(string.Format(AppResource.HandshakeError1, channel.ToString(), ex));
return true;
}
try
@@ -455,11 +453,9 @@ public partial class SiemensS7Master : DeviceBase
var result2 = await SendThenReturnMessageBaseAsync(new S7Send(S7_PN), channel).ConfigureAwait(false);
if (!result2.IsSuccess)
{
if (result2.Exception is OperationCanceledException)
return true;
Logger?.LogWarning(string.Format(AppResource.HandshakeError2, channel.ToString(), result2));
await channel.CloseAsync().ConfigureAwait(false);
if (result2.Exception is not OperationCanceledException)
Logger?.LogWarning(string.Format(AppResource.HandshakeError2, channel.ToString(), result2));
return true;
}
if (result2.Content == null)
@@ -471,10 +467,10 @@ public partial class SiemensS7Master : DeviceBase
Logger?.LogInformation($"PduLength{PduLength}");
PduLength = PduLength < 200 ? 200 : PduLength;
}
catch (OperationCanceledException) { }
catch (Exception ex)
{
Logger?.LogWarning(string.Format(AppResource.HandshakeError2, channel.ToString(), ex));
if (ex is not OperationCanceledException)
Logger?.LogWarning(string.Format(AppResource.HandshakeError2, channel.ToString(), ex));
await channel.CloseAsync().ConfigureAwait(false);
return true;
}
@@ -482,7 +478,8 @@ public partial class SiemensS7Master : DeviceBase
catch (Exception ex)
{
await channel.CloseAsync().ConfigureAwait(false);
Logger?.Exception(ex);
if (ex is not OperationCanceledException)
Logger?.Exception(ex);
}
finally
{

View File

@@ -10,6 +10,8 @@
using ThingsGateway.Gateway.Application;
using TouchSocket.Core;
namespace ThingsGateway.Plugin.Dlt645;
/// <summary>
@@ -49,6 +51,11 @@ public class Dlt645_2007Master : CollectFoundationBase
{
ArgumentNullException.ThrowIfNull(channel);
var plc = _plc;
_plc = new();
plc?.SafeDispose();
//载入配置
_plc.DtuId = _driverPropertys.DtuId;
_plc.SendDelayTime = _driverPropertys.SendDelayTime;

View File

@@ -11,6 +11,8 @@
using ThingsGateway.Debug;
using ThingsGateway.Gateway.Application;
using TouchSocket.Core;
namespace ThingsGateway.Plugin.Modbus;
/// <summary>
@@ -63,6 +65,9 @@ public class ModbusMaster : CollectFoundationBase
ArgumentNullException.ThrowIfNull(channel);
var plc = _plc;
_plc = new();
plc?.SafeDispose();
//载入配置
_plc.DataFormat = _driverPropertys.DataFormat;
_plc.DtuId = _driverPropertys.DtuId;

View File

@@ -22,7 +22,6 @@ using ThingsGateway.NewLife.Json.Extension;
using ThingsGateway.SqlSugar;
using TouchSocket.Core;
using TouchSocket.Sockets;
namespace ThingsGateway.Plugin.Modbus;
@@ -83,14 +82,16 @@ public class ModbusSlave : BusinessBase
/// <returns></returns>
protected override async Task ProtectedStartAsync(CancellationToken cancellationToken)
{
if (_plc?.Channel != null)
await _plc.Channel.ConnectAsync(_plc.Channel.ChannelOptions.ConnectTimeout, cancellationToken).ConfigureAwait(false);
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
}
/// <inheritdoc/>
protected override async Task InitChannelAsync(IChannel? channel, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(channel);
var plc = _plc;
_plc = new();
plc?.SafeDispose();
//载入配置
_plc.DataFormat = _driverPropertys.DataFormat;
_plc.IsStringReverseByteWord = _driverPropertys.IsStringReverseByteWord;
@@ -106,7 +107,7 @@ public class ModbusSlave : BusinessBase
try
{
await _plc.Channel.ConnectAsync(_plc.Channel.ChannelOptions.ConnectTimeout, CancellationToken.None).ConfigureAwait(false);
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
}
catch
{
@@ -158,8 +159,7 @@ public class ModbusSlave : BusinessBase
{
if (cancellationToken.IsCancellationRequested)
return;
await _plc.Channel.CloseAsync().ConfigureAwait(false);
await _plc.Channel.ConnectAsync(3000, cancellationToken).ConfigureAwait(false);
await _plc.ConnectAsync(cancellationToken).ConfigureAwait(false);
success = true;
}
catch (ObjectDisposedException) { }

View File

@@ -55,16 +55,27 @@ public class OpcDaMaster : CollectBase
ActiveSubscribe = _driverProperties.ActiveSubscribe,
CheckRate = _driverProperties.CheckRate
};
if (_plc == null)
var plc = _plc;
_plc = new();
if (plc != null)
{
_plc = new();
_plc.DataChangedHandler += DataChangedHandler;
_plc.LogEvent = (a, b, c, d) => LogMessage?.Log((LogLevel)a, b, c, d);
plc.DataChangedHandler -= DataChangedHandler;
plc.LogEvent = null;
plc.SafeDispose();
}
_plc.DataChangedHandler += DataChangedHandler;
_plc.LogEvent = Log;
_plc.Init(opcNode);
await base.InitChannelAsync(channel, cancellationToken).ConfigureAwait(false);
}
private void Log(byte level, object sender, string message, Exception ex)
{
LogMessage?.Log((LogLevel)level, sender, message, ex);
}
/// <inheritdoc/>
public override bool IsConnected() => _plc?.IsConnected == true;
@@ -195,6 +206,22 @@ public class OpcDaMaster : CollectBase
{
LogMessage?.LogWarning(ex);
}
if (VariableTasks.Count > 0)
{
foreach (var item in VariableTasks)
{
item.Stop();
TaskSchedulerLoop.Remove(item);
}
VariableTasks = AddVariableTask(cancellationToken);
foreach (var item in VariableTasks)
{
TaskSchedulerLoop.Add(item);
item.Start();
}
}
}
private Dictionary<string, List<VariableRuntime>> VariableAddresDicts { get; set; } = new();

View File

@@ -65,12 +65,18 @@ public class OpcUaMaster : CollectBase
LoadType = _driverProperties.LoadType,
AutoAcceptUntrustedCertificates = _driverProperties.AutoAcceptUntrustedCertificates,
};
if (_plc == null)
var plc = _plc;
_plc = new();
if (plc != null)
{
_plc = new();
_plc.LogEvent += _plc_LogEvent;
_plc.DataChangedHandler += DataChangedHandler;
plc.DataChangedHandler -= DataChangedHandler;
plc.LogEvent -= _plc_LogEvent;
plc.SafeDispose();
}
_plc.LogEvent += _plc_LogEvent;
_plc.DataChangedHandler += DataChangedHandler;
_plc.OpcUaProperty = config;
await base.InitChannelAsync(channel, cancellationToken).ConfigureAwait(false);
}
@@ -330,6 +336,22 @@ public class OpcUaMaster : CollectBase
}
}
if (VariableTasks.Count > 0)
{
foreach (var item in VariableTasks)
{
item.Stop();
TaskSchedulerLoop.Remove(item);
}
VariableTasks = AddVariableTask(cancellationToken);
foreach (var item in VariableTasks)
{
TaskSchedulerLoop.Add(item);
item.Start();
}
}
}
private Dictionary<string, List<VariableRuntime>> VariableAddresDicts { get; set; } = new();

View File

@@ -56,7 +56,13 @@ public class SiemensS7Master : CollectFoundationBase
protected override async Task InitChannelAsync(IChannel? channel = null, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(channel);
var plc = _plc;
_plc = new();
plc?.SafeDispose();
//载入配置
_plc.DataFormat = _driverPropertys.DataFormat;
_plc.SendDelayTime = _driverPropertys.SendDelayTime;

View File

@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.10" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.11" />
</ItemGroup>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>10.8.23</Version>
<Version>10.8.24</Version>
</PropertyGroup>
<ItemGroup>