From 56d93ff4363da052420fbfdce98d83b9873c7783 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 7 May 2019 11:29:35 +0800 Subject: [PATCH] Beautification code --- Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 2 +- Src/Asp.Net/SqlSugar/Abstract/AopProvider/AopProvider.cs | 4 ++-- .../Abstract/CodeFirstProvider/CodeFirstProvider.cs | 2 +- .../SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs | 2 +- .../SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs | 2 +- .../Abstract/DbBindProvider/IDataReaderEntityBuilder.cs | 6 +++--- .../Abstract/DbBindProvider/IDataRecordExtensions.cs | 2 +- .../SqlSugar/Abstract/DbMaintenanceProvider/Properties.cs | 2 +- .../Abstract/EntityMaintenance/EntityMaintenance.cs | 2 +- .../SqlSugar/Abstract/FilterProvider/FilterProvider.cs | 2 +- .../Abstract/InsertableProvider/InsertableProvider.cs | 2 +- .../Abstract/QueryableProvider/QueryableProvider.cs | 2 +- .../Abstract/SaveableProvider/SaveableProvider.cs | 6 +++--- .../SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs | 2 +- .../SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs | 2 +- .../SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs | 2 +- .../Abstract/SqlBuilderProvider/SqlBuilderProvider.cs | 2 +- .../Abstract/SqlBuilderProvider/SqlQueryBuilder.cs | 2 +- .../SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs | 2 +- .../Abstract/UpdateProvider/UpdateableProvider.cs | 2 +- Src/Asp.Net/SqlSugar/Entities/ModelContext.cs | 2 +- Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs | 6 +++--- .../{SqlSugarContext.cs => SqlSugarEngine.cs} | 4 ++-- .../{SqlSugarAccessory.cs => SqlSugarEngine_Part2.cs} | 2 +- Src/Asp.Net/SqlSugar/Interface/IAdo.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/ICodeFirst.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/IContextMethods.cs | 4 ++-- Src/Asp.Net/SqlSugar/Interface/IDMLBuilder.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/IDbBind.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/ILambdaExpressions.cs | 2 +- Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs | 2 +- .../SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs | 2 +- .../MySql/SqlBuilder/MySqlExpressionContext.cs | 2 +- .../Oracle/SqlBuilder/OracleExpressionContext.cs | 2 +- .../SqlServer/SqlBuilder/SqlServerExpressionContext.cs | 2 +- .../Sqlite/SqlBuilder/SqliteExpressionContext.cs | 2 +- Src/Asp.Net/SqlSugar/SqlSugar.csproj | 4 ++-- Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 2 +- Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs | 2 +- Src/Asp.Net/SqlSugar/Utilities/UtilExceptions.cs | 8 ++++---- 41 files changed, 54 insertions(+), 54 deletions(-) rename Src/Asp.Net/SqlSugar/Infrastructure/{SqlSugarContext.cs => SqlSugarEngine.cs} (99%) rename Src/Asp.Net/SqlSugar/Infrastructure/{SqlSugarAccessory.cs => SqlSugarEngine_Part2.cs} (99%) diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index d6200aa2f..4efa88dd3 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -34,7 +34,7 @@ namespace SqlSugar protected List OutputParameters { get; set; } public virtual string SqlParameterKeyWord { get { return "@"; } } public IDbTransaction Transaction { get; set; } - public virtual SqlSugarContext Context { get; set; } + public virtual SqlSugarEngine Context { get; set; } internal CommandType OldCommandType { get; set; } internal bool OldClearParameters { get; set; } public IDataParameterCollection DataReaderParameters { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/AopProvider/AopProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AopProvider/AopProvider.cs index 1e1b5610d..0b908ee5d 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AopProvider/AopProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AopProvider/AopProvider.cs @@ -8,12 +8,12 @@ namespace SqlSugar public class AopProvider { private AopProvider() { } - public AopProvider(SqlSugarContext context) + public AopProvider(SqlSugarEngine context) { this.Context = context; this.Context.Ado.IsEnableLogEvent = true; } - private SqlSugarContext Context { get; set; } + private SqlSugarEngine Context { get; set; } public Action OnDiffLogEvent { set { this.Context.CurrentConnectionConfig.AopEvents.OnDiffLogEvent = value; } } public Action OnError { set { this.Context.CurrentConnectionConfig.AopEvents.OnError = value; } } public Action OnLogExecuting { set { this.Context.CurrentConnectionConfig.AopEvents.OnLogExecuting= value; } } diff --git a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs index 68d5983fa..dc6f8f5bb 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs @@ -8,7 +8,7 @@ namespace SqlSugar public partial class CodeFirstProvider : ICodeFirst { #region Properties - public virtual SqlSugarContext Context { get; set; } + public virtual SqlSugarEngine Context { get; set; } protected bool IsBackupTable { get; set; } protected int MaxBackupDataRows { get; set; } protected virtual int DefultLength { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs index 061f5af87..78843a7d0 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs @@ -7,7 +7,7 @@ namespace SqlSugar { public partial class DbBindAccessory { - protected List GetEntityList(SqlSugarContext context, IDataReader dataReader) + protected List GetEntityList(SqlSugarEngine context, IDataReader dataReader) { Type type = typeof(T); var fieldNames = GetDataReaderNames(dataReader); diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs index 27c7b79bd..55b0b5655 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindProvider.cs @@ -10,7 +10,7 @@ namespace SqlSugar public abstract partial class DbBindProvider : DbBindAccessory, IDbBind { #region Properties - public virtual SqlSugarContext Context { get; set; } + public virtual SqlSugarEngine Context { get; set; } public abstract List> MappingTypes { get; } #endregion diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs index a4953f1f6..f6a46a3e2 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs @@ -22,7 +22,7 @@ namespace SqlSugar #endregion #region Fields - private SqlSugarContext Context = null; + private SqlSugarEngine Context = null; private IDataReaderEntityBuilder DynamicBuilder; private IDataRecord DataRecord; private static readonly MethodInfo isDBNullMethod = typeof(IDataRecord).GetMethod("IsDBNull", new Type[] { typeof(int) }); @@ -65,7 +65,7 @@ namespace SqlSugar private static readonly MethodInfo getOther = typeof(IDataRecordExtensions).GetMethod("GetOther"); private static readonly MethodInfo getSqliteTypeNull = typeof(IDataRecordExtensions).GetMethod("GetSqliteTypeNull"); private static readonly MethodInfo getSqliteType = typeof(IDataRecordExtensions).GetMethod("GetSqliteType"); - private static readonly MethodInfo getEntity = typeof(IDataRecordExtensions).GetMethod("GetEntity", new Type[] { typeof(SqlSugarContext) }); + private static readonly MethodInfo getEntity = typeof(IDataRecordExtensions).GetMethod("GetEntity", new Type[] { typeof(SqlSugarEngine) }); private delegate T Load(IDataRecord dataRecord); private Load handler; @@ -77,7 +77,7 @@ namespace SqlSugar } - public IDataReaderEntityBuilder(SqlSugarContext context, IDataRecord dataRecord,List fieldNames) + public IDataReaderEntityBuilder(SqlSugarEngine context, IDataRecord dataRecord,List fieldNames) { this.Context = context; this.DataRecord = dataRecord; diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs index cdbc6fdf2..18c7ade50 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs @@ -243,7 +243,7 @@ namespace SqlSugar return t; } - public static object GetEntity(this IDataReader dr, SqlSugarContext context) + public static object GetEntity(this IDataReader dr, SqlSugarEngine context) { return null; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Properties.cs b/Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Properties.cs index 610c1430f..f0375856c 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Properties.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Properties.cs @@ -9,7 +9,7 @@ namespace SqlSugar { #region Context private ISqlBuilder _SqlBuilder; - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ISqlBuilder SqlBuilder { get diff --git a/Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs b/Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs index 64e021d8c..cebcdd737 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs @@ -9,7 +9,7 @@ namespace SqlSugar { public class EntityMaintenance { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public EntityInfo GetEntityInfo() { diff --git a/Src/Asp.Net/SqlSugar/Abstract/FilterProvider/FilterProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/FilterProvider/FilterProvider.cs index e3b9ec5c7..8eca2f047 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/FilterProvider/FilterProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/FilterProvider/FilterProvider.cs @@ -7,7 +7,7 @@ namespace SqlSugar { public class QueryFilterProvider : IFilter { - internal SqlSugarContext Context { get; set; } + internal SqlSugarEngine Context { get; set; } private List _Filters { get; set; } public IFilter Add(SqlFilterItem filter) diff --git a/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs index a2eaf145c..97f6ef8c1 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs @@ -10,7 +10,7 @@ namespace SqlSugar { public class InsertableProvider : IInsertable where T : class, new() { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public IAdo Ado { get { return Context.Ado; } } public ISqlBuilder SqlBuilder { get; set; } public InsertBuilder InsertBuilder { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index b0bd594ed..95bf05598 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -1597,7 +1597,7 @@ namespace SqlSugar foreach (var item in result) { var contextProperty = item.GetType().GetProperty("Context"); - SqlSugarContext newClient = this.Context.Utilities.CopyContext(); + SqlSugarEngine newClient = this.Context.Utilities.CopyContext(); if (newClient.CurrentConnectionConfig.AopEvents == null) newClient.CurrentConnectionConfig.AopEvents = new AopEvents(); contextProperty.SetValue(item, newClient, null); diff --git a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/SaveableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/SaveableProvider.cs index ac23cd6d1..0672f74db 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/SaveableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/SaveableProvider.cs @@ -9,19 +9,19 @@ namespace SqlSugar { public partial class SaveableProvider : ISaveable where T : class, new() { - internal SaveableProvider(SqlSugarContext context,List saveObjects) + internal SaveableProvider(SqlSugarEngine context,List saveObjects) { this.saveObjects = saveObjects; this.Context = context; this.Context.InitMppingInfo(); } - internal SaveableProvider(SqlSugarContext context, T saveObject) + internal SaveableProvider(SqlSugarEngine context, T saveObject) { this.saveObjects = new List() { saveObject }; this.Context = context; this.Context.InitMppingInfo(); } - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public List saveObjects = new List(); public List existsObjects = null; public List insertObjects diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs index 5ce30a853..55c1100a7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs @@ -13,7 +13,7 @@ namespace SqlSugar #region Common Properties public EntityInfo EntityInfo { get; set; } - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ILambdaExpressions LambdaExpressions { get; set; } public List Parameters { get; set; } public StringBuilder sql { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs index c80df45ca..b6dd3a3e2 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/InsertBuilder.cs @@ -18,7 +18,7 @@ namespace SqlSugar #endregion #region Common Properties - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ILambdaExpressions LambdaExpressions { get; set; } public ISqlBuilder Builder { get; set; } public StringBuilder sql { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 3a2aa529b..77bf33dab 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -27,7 +27,7 @@ namespace SqlSugar #region Service object public StringBuilder sql { get; set; } - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ILambdaExpressions LambdaExpressions { get; set; } public ISqlBuilder Builder { get; set; } #endregion diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs index 26cb8b648..309d5b8ad 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs @@ -10,7 +10,7 @@ namespace SqlSugar public abstract partial class SqlBuilderProvider : SqlBuilderAccessory, ISqlBuilder { #region Properties - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public CommandType CommandType { get; set; } public DeleteBuilder DeleteBuilder { get; set; } public InsertBuilder InsertBuilder { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlQueryBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlQueryBuilder.cs index 713f41088..ea9a31aaf 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlQueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlQueryBuilder.cs @@ -17,7 +17,7 @@ namespace SqlSugar #endregion #region Properties - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public string Fields { get diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs index b68c59253..4243dca63 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/UpdateBuilder.cs @@ -17,7 +17,7 @@ namespace SqlSugar this.WhereValues = new List(); this.Parameters = new List(); } - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ILambdaExpressions LambdaExpressions { get; set; } public ISqlBuilder Builder { get; set; } public StringBuilder sql { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index 6b9fc74b3..457707817 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -12,7 +12,7 @@ namespace SqlSugar public class UpdateableProvider : IUpdateable where T : class, new() { #region Property - public SqlSugarContext Context { get; internal set; } + public SqlSugarEngine Context { get; internal set; } public EntityInfo EntityInfo { get; internal set; } public ISqlBuilder SqlBuilder { get; internal set; } public UpdateBuilder UpdateBuilder { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Entities/ModelContext.cs b/Src/Asp.Net/SqlSugar/Entities/ModelContext.cs index 4c55b635e..946c01db7 100644 --- a/Src/Asp.Net/SqlSugar/Entities/ModelContext.cs +++ b/Src/Asp.Net/SqlSugar/Entities/ModelContext.cs @@ -10,7 +10,7 @@ namespace SqlSugar { [SugarColumn(IsIgnore = true)] [JsonIgnore] - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public ISugarQueryable CreateMapping() where T : class, new() { Check.ArgumentNullException(Context, "Please use Sqlugar.ModelContext"); diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index b91ce9783..959316d89 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -11,7 +11,7 @@ namespace SqlSugar { public partial class ContextMethods : IContextMethods { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } #region DataReader /// @@ -268,9 +268,9 @@ namespace SqlSugar return DeserializeObject(jsonString); } } - public SqlSugarContext CopyContext(bool isCopyEvents = false) + public SqlSugarEngine CopyContext(bool isCopyEvents = false) { - var newClient = new SqlSugarContext(this.TranslateCopy(Context.CurrentConnectionConfig)); + var newClient = new SqlSugarEngine(this.TranslateCopy(Context.CurrentConnectionConfig)); newClient.CurrentConnectionConfig.ConfigureExternalServices = Context.CurrentConnectionConfig.ConfigureExternalServices; newClient.MappingColumns = this.TranslateCopy(Context.MappingColumns); newClient.MappingTables = this.TranslateCopy(Context.MappingTables); diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarContext.cs b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine.cs similarity index 99% rename from Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarContext.cs rename to Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine.cs index 23c01e142..c4a97993e 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarContext.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine.cs @@ -15,11 +15,11 @@ namespace SqlSugar /// ** dateļ¼š2017/1/2 /// ** email:610262374@qq.com /// - public partial class SqlSugarContext: ISqlSugarClient + public partial class SqlSugarEngine: ISqlSugarClient { #region Constructor - public SqlSugarContext(ConnectionConfig config) + public SqlSugarEngine(ConnectionConfig config) { this.Context = this; this.CurrentConnectionConfig = config; diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine_Part2.cs similarity index 99% rename from Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs rename to Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine_Part2.cs index 2448a6092..c1c6be2d4 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarEngine_Part2.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading.Tasks; namespace SqlSugar { - public partial class SqlSugarContext + public partial class SqlSugarEngine { #region Properties public ISqlSugarClient Context diff --git a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs index 61d604624..80e3c6051 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs @@ -16,7 +16,7 @@ namespace SqlSugar IDbTransaction Transaction { get; set; } IDataParameter[] ToIDbDataParameter(params SugarParameter[] pars); SugarParameter[] GetParameters(object obj, PropertyInfo[] propertyInfo = null); - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } void ExecuteBefore(string sql, SugarParameter[] pars); void ExecuteAfter(string sql, SugarParameter[] pars); bool IsEnableLogEvent{get;set;} diff --git a/Src/Asp.Net/SqlSugar/Interface/ICodeFirst.cs b/Src/Asp.Net/SqlSugar/Interface/ICodeFirst.cs index bf36e5a83..3a5ffcebb 100644 --- a/Src/Asp.Net/SqlSugar/Interface/ICodeFirst.cs +++ b/Src/Asp.Net/SqlSugar/Interface/ICodeFirst.cs @@ -6,7 +6,7 @@ namespace SqlSugar { public partial interface ICodeFirst { - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } ICodeFirst BackupTable(int maxBackupDataRows = int.MaxValue); ICodeFirst SetStringDefaultLength(int length); void InitTables(string entitiesNamespace); diff --git a/Src/Asp.Net/SqlSugar/Interface/IContextMethods.cs b/Src/Asp.Net/SqlSugar/Interface/IContextMethods.cs index 44777dee8..8e70ac867 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IContextMethods.cs @@ -10,14 +10,14 @@ namespace SqlSugar { public partial interface IContextMethods { - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } ExpandoObject DataReaderToExpandoObject(IDataReader reader); List DataReaderToExpandoObjectList(IDataReader reader); List DataReaderToList(IDataReader reader); string SerializeObject(object value); T DeserializeObject(string value); T TranslateCopy(T sourceObject); - SqlSugarContext CopyContext(bool isCopyEvents = false); + SqlSugarEngine CopyContext(bool isCopyEvents = false); dynamic DataTableToDynamic(DataTable table); List DataTableToList(DataTable table); ICacheService GetReflectionInoCacheInstance(); diff --git a/Src/Asp.Net/SqlSugar/Interface/IDMLBuilder.cs b/Src/Asp.Net/SqlSugar/Interface/IDMLBuilder.cs index 394d9e346..8e1ef17d8 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IDMLBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IDMLBuilder.cs @@ -9,7 +9,7 @@ namespace SqlSugar { string SqlTemplate { get; } List Parameters { get; set; } - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } StringBuilder sql { get; set; } string ToSqlString(); void Clear(); diff --git a/Src/Asp.Net/SqlSugar/Interface/IDbBind.cs b/Src/Asp.Net/SqlSugar/Interface/IDbBind.cs index cf4aa1f52..e82e734d5 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IDbBind.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IDbBind.cs @@ -7,7 +7,7 @@ namespace SqlSugar { public partial interface IDbBind { - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } List GuidThrow { get; } List IntThrow { get; } List StringThrow { get; } diff --git a/Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs b/Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs index 19b7374f0..33aab4ba3 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs @@ -6,7 +6,7 @@ namespace SqlSugar { public partial interface IDbMaintenance { - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } #region DML List GetViewInfoList(bool isCache=true); diff --git a/Src/Asp.Net/SqlSugar/Interface/ILambdaExpressions.cs b/Src/Asp.Net/SqlSugar/Interface/ILambdaExpressions.cs index c12caf716..6bb7e8dc3 100644 --- a/Src/Asp.Net/SqlSugar/Interface/ILambdaExpressions.cs +++ b/Src/Asp.Net/SqlSugar/Interface/ILambdaExpressions.cs @@ -15,7 +15,7 @@ namespace SqlSugar List JoinQueryInfos { get; set; } bool IsSingle { get; set; } - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } IDbMethods DbMehtods { get; set; } Expression Expression { get; set; } int Index { get; set; } diff --git a/Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs b/Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs index 5d9717539..d615a1b3a 100644 --- a/Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Interface/ISqlBuilder.cs @@ -10,7 +10,7 @@ namespace SqlSugar { public partial interface ISqlBuilder { - SqlSugarContext Context { get; set; } + SqlSugarEngine Context { get; set; } CommandType CommandType { get; set; } String AppendWhereOrAnd(bool isWhere, string sqlString); string AppendHaving(string sqlString); diff --git a/Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs b/Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs index c0c869acc..1d92aa081 100644 --- a/Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/OnlyNet/PostgreSQLExpressionContext.cs @@ -10,7 +10,7 @@ namespace SqlSugar } internal class PostgreSQLExpressionContext : ExpressionContext, ILambdaExpressions { - public SqlSugarContext Context + public SqlSugarEngine Context { get { diff --git a/Src/Asp.Net/SqlSugar/Realization/MySql/SqlBuilder/MySqlExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/MySql/SqlBuilder/MySqlExpressionContext.cs index e1b54430a..fd9e66ffc 100644 --- a/Src/Asp.Net/SqlSugar/Realization/MySql/SqlBuilder/MySqlExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/MySql/SqlBuilder/MySqlExpressionContext.cs @@ -4,7 +4,7 @@ namespace SqlSugar { public class MySqlExpressionContext : ExpressionContext, ILambdaExpressions { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public MySqlExpressionContext() { base.DbMehtods = new MySqlMethod(); diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs index 4a929a9a4..cf6d9dd33 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs @@ -11,7 +11,7 @@ namespace SqlSugar { public partial class OracleExpressionContext : ExpressionContext, ILambdaExpressions { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public OracleExpressionContext() { base.DbMehtods = new OracleMethod(); diff --git a/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerExpressionContext.cs index dddffe193..fc4c6f75e 100644 --- a/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerExpressionContext.cs @@ -11,7 +11,7 @@ namespace SqlSugar { public partial class SqlServerExpressionContext : ExpressionContext, ILambdaExpressions { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public SqlServerExpressionContext() { base.DbMehtods = new SqlServerMethod(); diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs index a66559cda..61ea71aa8 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs @@ -4,7 +4,7 @@ namespace SqlSugar { public class SqliteExpressionContext : ExpressionContext, ILambdaExpressions { - public SqlSugarContext Context { get; set; } + public SqlSugarEngine Context { get; set; } public SqliteExpressionContext() { base.DbMehtods = new SqliteMethod(); diff --git a/Src/Asp.Net/SqlSugar/SqlSugar.csproj b/Src/Asp.Net/SqlSugar/SqlSugar.csproj index 89845e7c9..99ec4327d 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugar.csproj +++ b/Src/Asp.Net/SqlSugar/SqlSugar.csproj @@ -277,8 +277,8 @@ - - + + diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index a996288a5..0e80161b6 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -691,7 +691,7 @@ namespace SqlSugar { config.AopEvents = new AopEvents(); } - _Context = new SqlSugarContext(config); + _Context = new SqlSugarEngine(config); if (!aopIsNull) _Context.Ado.IsEnableLogEvent = true; this.CurrentConnectionConfig = config; diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs index 02342d66a..57feb167a 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs @@ -42,6 +42,6 @@ namespace SqlSugar internal static Type DicArraySS = typeof(Dictionary); internal static Type DicArraySO = typeof(Dictionary); - public static Type SugarType = typeof(SqlSugarContext); + public static Type SugarType = typeof(SqlSugarEngine); } } diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilExceptions.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilExceptions.cs index 811329387..dbc861290 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilExceptions.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilExceptions.cs @@ -18,18 +18,18 @@ namespace SqlSugar public SqlSugarException(string message) : base(message){} - public SqlSugarException(SqlSugarContext context,string message, string sql) + public SqlSugarException(SqlSugarEngine context,string message, string sql) : base(message) { this.Sql = sql; } - public SqlSugarException(SqlSugarContext context, string message, string sql, object pars) + public SqlSugarException(SqlSugarEngine context, string message, string sql, object pars) : base(message) { this.Sql = sql; this.Parametres = pars; } - public SqlSugarException(SqlSugarContext context, Exception ex, string sql, object pars) + public SqlSugarException(SqlSugarEngine context, Exception ex, string sql, object pars) : base(ex.Message) { this.Sql = sql; @@ -40,7 +40,7 @@ namespace SqlSugar this.Source = ex.Source; } - public SqlSugarException(SqlSugarContext context, string message, object pars) + public SqlSugarException(SqlSugarEngine context, string message, object pars) : base(message) { this.Parametres = pars; }