You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using Mesnac.Action.ChemicalWeighing.Sys;
|
|
using Mesnac.Codd.Session;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.FreeDb
|
|
{
|
|
public class FreeSqlUnit
|
|
{
|
|
private static IFreeSql _instance = null;
|
|
|
|
private FreeSqlUnit() { }
|
|
|
|
public static IFreeSql Instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
|
|
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
|
|
|
|
_instance = new FreeSql.FreeSqlBuilder()
|
|
.UseConnectionString(FreeSql.DataType.SqlServer, dbHelper.DbSession.ConnectionString)
|
|
.UseAutoSyncStructure(false) //自动同步实体结构到数据库
|
|
.Build(); //请务必定义成 Singleton 单例模式
|
|
}
|
|
return _instance;
|
|
}
|
|
}
|
|
|
|
internal static T Select<T>()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|