2 Commits
Author SHA1 Message Date
Adam 08010bc6a3 Merge branch 'FruitBank_v0.0.8.2' of https://git.aycode.com/Adam/Mango.Nop.Libraries into FruitBank_v0.0.8.2 2026-08-19 00:18:49 +02:00
Adam 514254689a MgDtoDbTableBase declares its IConsumer interfaces so the DTO event bridge runs
The three HandleEventAsync methods were dead code: nop registers and resolves
consumers by interface only, so EntityUpdatedEvent<TDtoEntity> reached no one and
never became the main entity event - silently, because zero consumers is not an
error. The declaration needs Nop.Services, where IConsumer<T> lives, hence the new
project reference.
2026-08-18 20:04:34 +02:00
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -18,6 +18,8 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\FruitBank\Libraries\Nop.Core\Nop.Core.csproj" />
<ProjectReference Include="..\..\..\..\FruitBank\Libraries\Nop.Data\Nop.Data.csproj" />
<!-- IConsumer<T> a Nop.Services.Events-ben lakik; enélkül a DTO->fő-entitás esemény-híd nem deklarálható. -->
<ProjectReference Include="..\..\..\..\FruitBank\Libraries\Nop.Services\Nop.Services.csproj" />
<ProjectReference Include="..\Mango.Nop.Core\Mango.Nop.Core.csproj" />
</ItemGroup>
@@ -7,10 +7,19 @@ using Nop.Core.Configuration;
using Nop.Core.Domain.Orders;
using Nop.Core.Events;
using Nop.Data;
using Nop.Services.Events;
namespace Mango.Nop.Data.Repositories;
public abstract class MgDtoDbTableBase<TDtoEntity, TMainEntity> : MgDbTableBase<TDtoEntity> where TDtoEntity : BaseEntity/*, IMgModelDtoBase<TDtoEntity>*/ where TMainEntity : BaseEntity
// A három IConsumer<> deklaráció NEM elhagyható: a nop kizárólag interfész alapján regisztrál
// (NopStartup: FindClassesOfType(typeof(IConsumer<>))) és old fel (EventPublisher: ResolveAll<IConsumer<TEvent>>).
// Nélkülük az alábbi HandleEventAsync metódusok halott kódok — a DTO-esemény sosem lesz fő-entitás eseménnyé,
// és ez némán történik, mert a nulla fogyasztó nem hiba.
public abstract class MgDtoDbTableBase<TDtoEntity, TMainEntity> : MgDbTableBase<TDtoEntity>,
IConsumer<EntityInsertedEvent<TDtoEntity>>,
IConsumer<EntityUpdatedEvent<TDtoEntity>>,
IConsumer<EntityDeletedEvent<TDtoEntity>>
where TDtoEntity : BaseEntity/*, IMgModelDtoBase<TDtoEntity>*/ where TMainEntity : BaseEntity
{
public Type MainEntityType { get; } = typeof(Order);