improvement
This commit is contained in:
parent
bf21342abb
commit
3197542c83
|
|
@ -0,0 +1,20 @@
|
||||||
|
namespace Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
|
public interface IMgDalBase //: IAcDalBase//: IDisposable
|
||||||
|
{
|
||||||
|
public string Name { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IMgDalBase<out TDbContext> : IMgDalBase where TDbContext : IMgDbContextBase
|
||||||
|
{
|
||||||
|
//public bool AutoCloseSession { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Do not use it! Use Session or Transaction... - J.
|
||||||
|
/// </summary>
|
||||||
|
public TDbContext Context { get; }
|
||||||
|
public Mutex MutextLock { get; }
|
||||||
|
|
||||||
|
//public TDbContext CreateDbContext();
|
||||||
|
//public void CloseDbContext(ref TDbContext? ctx);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
|
public interface IMgDbContextBase //: IAcDbContextBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using Mango.Nop.Core.Entities;
|
||||||
|
using Nop.Data;
|
||||||
|
|
||||||
|
namespace Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
|
public interface IMgDbTableBase //: IAcDbTableBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//public interface IMgDbTableBase<TAuction> /*: IAcDbTableBase*/ where TAuction : EntityBase
|
||||||
|
//{
|
||||||
|
// IRepository<TAuction>
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public interface IMgDbTableBase<TRepository, TAuction> /*: IAcDbTableBase*/ where TAuction : EntityBase where TRepository : IRepository<TAuction>
|
||||||
|
//{}
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
using System.Linq.Expressions;
|
|
||||||
using Nop.Core;
|
|
||||||
using Nop.Core.Caching;
|
|
||||||
using Nop.Core.Configuration;
|
|
||||||
using Nop.Core.Events;
|
|
||||||
using Nop.Data;
|
|
||||||
|
|
||||||
namespace Mango.Nop.Core.Repositories;
|
|
||||||
|
|
||||||
public class DalBase<TEntity> : EntityRepository<TEntity> where TEntity : BaseEntity
|
|
||||||
{
|
|
||||||
public DalBase(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.Transactions;
|
||||||
|
using Mango.Nop.Core.Interfaces;
|
||||||
|
using Nop.Core;
|
||||||
|
using Nop.Core.Caching;
|
||||||
|
using Nop.Core.Configuration;
|
||||||
|
using Nop.Core.Events;
|
||||||
|
using Nop.Data;
|
||||||
|
using Nop.Data.DataProviders;
|
||||||
|
|
||||||
|
namespace Mango.Nop.Core.Repositories;
|
||||||
|
|
||||||
|
public class MgDalBase<TDbContext> : IMgDalBase<TDbContext> where TDbContext : IMgDbContextBase
|
||||||
|
{
|
||||||
|
public string Name { get; }
|
||||||
|
public TDbContext Context { get; }
|
||||||
|
public Mutex MutextLock { get; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
using Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
|
namespace Mango.Nop.Core.Repositories;
|
||||||
|
|
||||||
|
|
||||||
|
public class MgDbContextBase : IMgDbContextBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue