improvements
This commit is contained in:
parent
1e2856c565
commit
38ec5c475e
|
|
@ -3,6 +3,6 @@ using Nop.Core;
|
||||||
|
|
||||||
namespace Mango.Nop.Core.Entities;
|
namespace Mango.Nop.Core.Entities;
|
||||||
|
|
||||||
public class EntityBase : BaseEntity, IEntityInt
|
public class MgEntityBase : BaseEntity, IEntityInt
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -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 ISoftRemoveEntity : IAcSoftRemoveEntity, ISoftDeletedEntity
|
public interface IMgSoftRemoveEntity : 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 ISoftRemoveEntityInt : IAcSoftRemoveEntityInt, ISoftRemoveEntity
|
public interface IMgSoftRemoveEntityInt : IAcSoftRemoveEntityInt, IMgSoftRemoveEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Mango.Nop.Core.Interfaces;
|
using System.Linq.Expressions;
|
||||||
|
using Mango.Nop.Core.Interfaces;
|
||||||
using Nop.Core;
|
using Nop.Core;
|
||||||
using Nop.Core.Caching;
|
using Nop.Core.Caching;
|
||||||
using Nop.Core.Configuration;
|
using Nop.Core.Configuration;
|
||||||
|
|
@ -7,9 +8,72 @@ using Nop.Data;
|
||||||
|
|
||||||
namespace Mango.Nop.Core.Repositories;
|
namespace Mango.Nop.Core.Repositories;
|
||||||
|
|
||||||
public class MgDbTableBase<TEntity>: EntityRepository<TEntity>, IMgDbTableBase where TEntity : BaseEntity
|
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
|
||||||
{
|
{
|
||||||
public MgDbTableBase(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings)
|
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