2025-09-25 14:37:10 +08:00
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2025-10-09 16:26:44 +08:00
|
|
|
|
using LM.Core.DBManager;
|
2025-09-25 14:37:10 +08:00
|
|
|
|
|
2025-10-09 16:26:44 +08:00
|
|
|
|
namespace LM.Core.DbContext
|
2025-09-25 14:37:10 +08:00
|
|
|
|
{
|
|
|
|
|
|
public abstract class DbContext
|
|
|
|
|
|
{
|
|
|
|
|
|
public virtual ISqlSugarClient SqlSugarClient { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool QueryTracking
|
|
|
|
|
|
{
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public DbContext() : base() { }
|
|
|
|
|
|
|
|
|
|
|
|
public virtual ISugarQueryable<TEntity> Set<TEntity>(bool filterDeleted = false) where TEntity : class
|
|
|
|
|
|
{
|
|
|
|
|
|
return this.SqlSugarClient.Set<TEntity>(filterDeleted);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SaveChanges()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SqlSugarClient.SaveQueues();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|