From b1dd6c96e5b1697aef80a46b24dcbad084bdd638 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 6 Sep 2017 10:21:59 +0800 Subject: [PATCH] Code optimization --- .../Infrastructure/SqlSugarAccessory.cs | 1 + Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 23 +++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs index 717596985..a25de7035 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/SqlSugarAccessory.cs @@ -13,6 +13,7 @@ namespace SqlSugar public SqlSugarClient Context { get; set; } public ConnectionConfig CurrentConnectionConfig { get; set; } public Dictionary TempItems { get; set; } + public bool IsSystemTablesConfig { get { return this.CurrentConnectionConfig.InitKeyType == InitKeyType.SystemTable; } } public Guid ContextID { get; set; } public MappingTableList MappingTables = new MappingTableList(); public MappingColumnList MappingColumns = new MappingColumnList(); diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index 052dc122c..cfc3f7c6c 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -16,16 +16,7 @@ namespace SqlSugar /// public partial class SqlSugarClient : SqlSugarAccessory, IDisposable { - #region Properties - public bool IsSystemTablesConfig - { - get - { - return this.CurrentConnectionConfig.InitKeyType == InitKeyType.SystemTable; - } - } - #endregion - + #region Constructor public SqlSugarClient(ConnectionConfig config) { @@ -508,10 +499,7 @@ namespace SqlSugar } return _EntityProvider; } - set - { - base._EntityProvider = value; - } + set { base._EntityProvider = value; } } #endregion @@ -527,10 +515,7 @@ namespace SqlSugar } return _QueryFilterProvider; } - set - { - base._QueryFilterProvider = value; - } + set { base._QueryFilterProvider = value; } } #endregion @@ -540,9 +525,7 @@ namespace SqlSugar get { if (_SimpleClient == null) - { _SimpleClient = new SimpleClient(this); - } return _SimpleClient; } }