CAMERA V1

This commit is contained in:
2025-09-11 20:29:17 +08:00
parent c7165f0dc5
commit ccbe0f626f
135 changed files with 26211 additions and 182 deletions

View File

@@ -0,0 +1,33 @@
using FATrace.Com;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FATrace.OEMApp
{
public class FSqlContext
{
private static readonly Lazy<IFreeSql> LazyFreeSql = new Lazy<IFreeSql>(() =>
{
var connectionString = ConfigHelper.GetRequiredConnectionString("connecting");
try
{
return new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.SqlServer, connectionString)
.UseAutoSyncStructure(false)
.Build();
}
catch (Exception ex)
{
throw new InvalidOperationException("初始化数据库连接失败,请检查连接字符串与数据库网络连通性。", ex);
}
});
/// <summary>
/// 获取单例数据库实例。
/// </summary>
public static IFreeSql FDb => LazyFreeSql.Value;
}
}