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.
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
namespace Txgy.EWS.Client.Common
|
|
|
|
|
{
|
|
|
|
|
public class FreeSqlTencent
|
|
|
|
|
{
|
|
|
|
|
private static Lazy<IFreeSql> mySQLLazy = CreateLazy();
|
|
|
|
|
|
|
|
|
|
public static IFreeSql tencentRemoteMySQL => mySQLLazy.Value;
|
|
|
|
|
|
|
|
|
|
public static void Reset()
|
|
|
|
|
{
|
|
|
|
|
if (mySQLLazy.IsValueCreated)
|
|
|
|
|
{
|
|
|
|
|
mySQLLazy.Value.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mySQLLazy = CreateLazy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Lazy<IFreeSql> CreateLazy()
|
|
|
|
|
{
|
|
|
|
|
return new Lazy<IFreeSql>(() => new FreeSql.FreeSqlBuilder()
|
|
|
|
|
.UseMonitorCommand(cmd => Trace.WriteLine($"Sql:{cmd.CommandText}"))
|
|
|
|
|
.UseConnectionString(FreeSql.DataType.MySql, BusinessConfigManager.GetConnectionString("TencetnMySQL"))
|
|
|
|
|
.Build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|