Compare commits
No commits in common. "38ec5c475e567b5a839b352dff40c8b915a6747d" and "bf21342abbe23568d5f2505dfab8ac18bc53001a" have entirely different histories.
38ec5c475e
...
bf21342abb
|
|
@ -3,6 +3,6 @@ using Nop.Core;
|
||||||
|
|
||||||
namespace Mango.Nop.Core.Entities;
|
namespace Mango.Nop.Core.Entities;
|
||||||
|
|
||||||
public class MgEntityBase : BaseEntity, IEntityInt
|
public class EntityBase : BaseEntity, IEntityInt
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
namespace Mango.Nop.Core.Interfaces;
|
|
||||||
|
|
||||||
public interface IMgDbContextBase //: IAcDbContextBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
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>
|
|
||||||
//{}
|
|
||||||
|
|
@ -4,7 +4,7 @@ using Nop.Core.Domain.Common;
|
||||||
namespace Mango.Nop.Core.Interfaces;
|
namespace Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
// ReSharper disable once PossibleInterfaceMemberAmbiguity
|
// ReSharper disable once PossibleInterfaceMemberAmbiguity
|
||||||
public interface IMgSoftRemoveEntity : IAcSoftRemoveEntity, ISoftDeletedEntity
|
public interface ISoftRemoveEntity : IAcSoftRemoveEntity, ISoftDeletedEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
namespace Mango.Nop.Core.Interfaces;
|
namespace Mango.Nop.Core.Interfaces;
|
||||||
|
|
||||||
// ReSharper disable once PossibleInterfaceMemberAmbiguity
|
// ReSharper disable once PossibleInterfaceMemberAmbiguity
|
||||||
public interface IMgSoftRemoveEntityInt : IAcSoftRemoveEntityInt, IMgSoftRemoveEntity
|
public interface ISoftRemoveEntityInt : IAcSoftRemoveEntityInt, ISoftRemoveEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
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; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
using Mango.Nop.Core.Interfaces;
|
|
||||||
using Nop.Data;
|
|
||||||
|
|
||||||
namespace Mango.Nop.Core.Repositories;
|
|
||||||
|
|
||||||
|
|
||||||
public class MgDbContextBase : IMgDbContextBase
|
|
||||||
{
|
|
||||||
protected INopDataProvider DataProvider;
|
|
||||||
|
|
||||||
public MgDbContextBase(INopDataProvider dataProvider)
|
|
||||||
{
|
|
||||||
DataProvider = dataProvider;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
using System.Linq.Expressions;
|
|
||||||
using Mango.Nop.Core.Interfaces;
|
|
||||||
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 MgDbTableBase<TEntity>(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings)
|
|
||||||
: EntityRepository<TEntity>(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings), IMgDbTableBase where TEntity : BaseEntity
|
|
||||||
{
|
|
||||||
protected IEventPublisher EventPublisher = eventPublisher;
|
|
||||||
protected INopDataProvider DataProvider = dataProvider;
|
|
||||||
protected IShortTermCacheManager ShortTermCacheManager = shortTermCacheManager;
|
|
||||||
protected IStaticCacheManager StaticCacheManager = staticCacheManager;
|
|
||||||
|
|
||||||
|
|
||||||
public override void Update(TEntity entity, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
base.Update(entity, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Update(IList<TEntity> entities, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
base.Update(entities, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task UpdateAsync(TEntity entity, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
return base.UpdateAsync(entity, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task UpdateAsync(IList<TEntity> entities, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
return base.UpdateAsync(entities, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Task DeleteAsync(IList<TEntity> entities)
|
|
||||||
{
|
|
||||||
return base.DeleteAsync(entities);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Task DeleteAsync<T>(IList<T> entities)
|
|
||||||
{
|
|
||||||
return base.DeleteAsync(entities);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IQueryable<TEntity> AddDeletedFilter(IQueryable<TEntity> query, in bool includeDeleted)
|
|
||||||
{
|
|
||||||
return base.AddDeletedFilter(query, in includeDeleted);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task DeleteAsync(TEntity entity, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
return base.DeleteAsync(entity, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task DeleteAsync(IList<TEntity> entities, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
return base.DeleteAsync(entities, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task<int> DeleteAsync(Expression<Func<TEntity, bool>> predicate)
|
|
||||||
{
|
|
||||||
return base.DeleteAsync(predicate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Delete(TEntity entity, bool publishEvent = true)
|
|
||||||
{
|
|
||||||
base.Delete(entity, publishEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Delete(Expression<Func<TEntity, bool>> predicate)
|
|
||||||
{
|
|
||||||
return base.Delete(predicate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue