添加freeSql

main
liulb@mesnac.com 1 year ago
parent 436be184ae
commit 0a039c28f5

@ -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
{
/// <summary>
/// FreeORM
/// </summary>
public class FreeHelper
{
public static IFreeSql Instance => freeSql.Value;
static Lazy<IFreeSql> freeSql = new Lazy<IFreeSql>(() =>
{
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();
});
}
}

@ -110,6 +110,21 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath> <HintPath>..\..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath>
</Reference> </Reference>
<Reference Include="FreeSql">
<HintPath>..\..\..\..\XL\dll\FreeSql.dll</HintPath>
</Reference>
<Reference Include="FreeSql.DbContext">
<HintPath>..\..\..\..\XL\dll\FreeSql.DbContext.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Extensions.LazyLoading">
<HintPath>..\..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Provider.SqlServer">
<HintPath>..\..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Repository">
<HintPath>..\..\..\..\XL\dll\FreeSql.Repository.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PlugInPlatform\ICSharpCode.Core.dll</HintPath> <HintPath>..\..\..\PlugInPlatform\ICSharpCode.Core.dll</HintPath>
@ -242,6 +257,7 @@
<Compile Include="CylinderManage\InitFormAction.cs" /> <Compile Include="CylinderManage\InitFormAction.cs" />
<Compile Include="CylinderManage\InsertAction.cs" /> <Compile Include="CylinderManage\InsertAction.cs" />
<Compile Include="CylinderManage\RefreshAction.cs" /> <Compile Include="CylinderManage\RefreshAction.cs" />
<Compile Include="DBHelper\FreeHelper.cs" />
<Compile Include="DeviceParamManage\InitDeviceParamInfo.cs" /> <Compile Include="DeviceParamManage\InitDeviceParamInfo.cs" />
<Compile Include="DeviceParamManage\SelectDeviceParamInfo.cs" /> <Compile Include="DeviceParamManage\SelectDeviceParamInfo.cs" />
<Compile Include="DeviceParamManage\WriteDeviceParamInfo.cs" /> <Compile Include="DeviceParamManage\WriteDeviceParamInfo.cs" />

@ -82,6 +82,21 @@
<Reference Include="FastReport.VSDesign"> <Reference Include="FastReport.VSDesign">
<HintPath>..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath> <HintPath>..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath>
</Reference> </Reference>
<Reference Include="FreeSql">
<HintPath>..\..\..\XL\dll\FreeSql.dll</HintPath>
</Reference>
<Reference Include="FreeSql.DbContext">
<HintPath>..\..\..\XL\dll\FreeSql.DbContext.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Extensions.LazyLoading">
<HintPath>..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Provider.SqlServer">
<HintPath>..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Repository">
<HintPath>..\..\..\XL\dll\FreeSql.Repository.dll</HintPath>
</Reference>
<Reference Include="Host, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Host, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Libraries\Host.dll</HintPath> <HintPath>..\..\Libraries\Host.dll</HintPath>

@ -77,6 +77,21 @@
<Reference Include="FastReport.Editor"> <Reference Include="FastReport.Editor">
<HintPath>..\..\A3Lib\FastReport\FastReport.Editor.dll</HintPath> <HintPath>..\..\A3Lib\FastReport\FastReport.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="FreeSql">
<HintPath>..\..\..\XL\dll\FreeSql.dll</HintPath>
</Reference>
<Reference Include="FreeSql.DbContext">
<HintPath>..\..\..\XL\dll\FreeSql.DbContext.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Extensions.LazyLoading">
<HintPath>..\..\..\XL\dll\FreeSql.Extensions.LazyLoading.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Provider.SqlServer">
<HintPath>..\..\..\XL\dll\FreeSql.Provider.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FreeSql.Repository">
<HintPath>..\..\..\XL\dll\FreeSql.Repository.dll</HintPath>
</Reference>
<Reference Include="Host, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Host, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Libraries\Host.dll</HintPath> <HintPath>..\..\Libraries\Host.dll</HintPath>

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save