diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/DBHelper/FreeHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/DBHelper/FreeHelper.cs new file mode 100644 index 0000000..5654b37 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/DBHelper/FreeHelper.cs @@ -0,0 +1,28 @@ +using Mesnac.Codd.Session; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mesnac.Action.ChemicalWeighing.DBHelper +{ + /// + /// FreeORM + /// + public class FreeHelper + { + public static IFreeSql Instance => freeSql.Value; + + static Lazy freeSql = new Lazy(() => + { + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + return new FreeSql.FreeSqlBuilder() + .UseMonitorCommand(cmd => Trace.WriteLine($"Sql:{cmd.CommandText}"))//监听SQL语句,Trace在输出选项卡中查看 + .UseConnectionString(FreeSql.DataType.SqlServer, dbHelper.DbSession.ConnectionString) + .UseAutoSyncStructure(false) //自动同步实体结构到数据库,FreeSql不会扫描程序集,只有CRUD时才会生成表。 + .Build(); + }); + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index a0bfa97..bb42004 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -110,6 +110,21 @@ False ..\..\..\A3Lib\FastReport\FastReport.VSDesign.dll + + ..\..\..\..\XL\dll\FreeSql.dll + + + ..\..\..\..\XL\dll\FreeSql.DbContext.dll + + + ..\..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll + + + ..\..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll + + + ..\..\..\..\XL\dll\FreeSql.Repository.dll + False ..\..\..\PlugInPlatform\ICSharpCode.Core.dll @@ -242,6 +257,7 @@ + diff --git a/Main/MCEdit/MCEdit.csproj b/Main/MCEdit/MCEdit.csproj index 6945b05..f89b947 100644 --- a/Main/MCEdit/MCEdit.csproj +++ b/Main/MCEdit/MCEdit.csproj @@ -82,6 +82,21 @@ ..\..\A3Lib\FastReport\FastReport.VSDesign.dll + + ..\..\..\XL\dll\FreeSql.dll + + + ..\..\..\XL\dll\FreeSql.DbContext.dll + + + ..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll + + + ..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll + + + ..\..\..\XL\dll\FreeSql.Repository.dll + False ..\..\Libraries\Host.dll diff --git a/Main/MCRun/MCRun.csproj b/Main/MCRun/MCRun.csproj index 67eb51b..514a184 100644 --- a/Main/MCRun/MCRun.csproj +++ b/Main/MCRun/MCRun.csproj @@ -77,6 +77,21 @@ ..\..\A3Lib\FastReport\FastReport.Editor.dll + + ..\..\..\XL\dll\FreeSql.dll + + + ..\..\..\XL\dll\FreeSql.DbContext.dll + + + ..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll + + + ..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll + + + ..\..\..\XL\dll\FreeSql.Repository.dll + False ..\..\Libraries\Host.dll diff --git a/dll/FreeSql.DbContext.dll b/dll/FreeSql.DbContext.dll new file mode 100644 index 0000000..c8f4110 Binary files /dev/null and b/dll/FreeSql.DbContext.dll differ diff --git a/dll/FreeSql.Extensions.LazyLoading.dll b/dll/FreeSql.Extensions.LazyLoading.dll new file mode 100644 index 0000000..8f7bfa2 Binary files /dev/null and b/dll/FreeSql.Extensions.LazyLoading.dll differ diff --git a/dll/FreeSql.Provider.SqlServer.dll b/dll/FreeSql.Provider.SqlServer.dll new file mode 100644 index 0000000..1fa2657 Binary files /dev/null and b/dll/FreeSql.Provider.SqlServer.dll differ diff --git a/dll/FreeSql.Repository.dll b/dll/FreeSql.Repository.dll new file mode 100644 index 0000000..3f207d1 Binary files /dev/null and b/dll/FreeSql.Repository.dll differ diff --git a/dll/FreeSql.dll b/dll/FreeSql.dll new file mode 100644 index 0000000..56ecf2c Binary files /dev/null and b/dll/FreeSql.dll differ