Browse Source

Rename IgnoreEventSelectors to IgnoredEventSelectors.

pull/22471/head
maliming 1 year ago
parent
commit
78f972c41f
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      docs/en/framework/infrastructure/event-bus/distributed/index.md
  2. 4
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs
  3. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs
  4. 4
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs
  5. 4
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs
  6. 2
      framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs

4
docs/en/framework/infrastructure/event-bus/distributed/index.md

@ -299,12 +299,12 @@ Configure<AbpDistributedEntityEventOptions>(options =>
);
//Ignore for a single entity
options.IgnoreEventSelectors.Add<IgnoreProduct>();
options.IgnoredEventSelectors.Add<IgnoredProductEntity>();
});
````
* The `type.Namespace.StartsWith("MyProject.")` provides flexibility to decide if the events should be published for the given entity type. Returns `true` to accept a `Type`.
* The `IgnoreEventSelectors` is used to ignore the events for the specified entity types. It is useful if you enabled for all entities and want to ignore for some entities.
* The `IgnoredEventSelectors` is used to ignore the events for the specified entity types. It is useful if you enabled for all entities and want to ignore for some entities.
You can add more than one selector. If one of the selectors match for an entity type, then it is selected.

4
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs

@ -4,14 +4,14 @@ public class AbpDistributedEntityEventOptions
{
public IAutoEntityDistributedEventSelectorList AutoEventSelectors { get; }
public IAutoEntityDistributedEventSelectorList IgnoreEventSelectors { get; }
public IAutoEntityDistributedEventSelectorList IgnoredEventSelectors { get; }
public EtoMappingDictionary EtoMappings { get; set; }
public AbpDistributedEntityEventOptions()
{
AutoEventSelectors = new AutoEntityDistributedEventSelectorList();
IgnoreEventSelectors = new AutoEntityDistributedEventSelectorList();
IgnoredEventSelectors = new AutoEntityDistributedEventSelectorList();
EtoMappings = new EtoMappingDictionary();
}
}

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs

@ -69,7 +69,7 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen
private bool ShouldPublishDistributedEventForEntity(object entity)
{
var entityType = ProxyHelper.UnProxy(entity).GetType();
return !DistributedEntityEventOptions.IgnoreEventSelectors.IsMatch(entityType) &&
return !DistributedEntityEventOptions.IgnoredEventSelectors.IsMatch(entityType) &&
DistributedEntityEventOptions.AutoEventSelectors.IsMatch(entityType);
}

4
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs

@ -32,8 +32,8 @@ public class AbpEntityFrameworkCoreModule : AbpModule
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.IgnoreEventSelectors.Add<OutgoingEventRecord>();
options.IgnoreEventSelectors.Add<IncomingEventRecord>();
options.IgnoredEventSelectors.Add<OutgoingEventRecord>();
options.IgnoredEventSelectors.Add<IncomingEventRecord>();
});
}
}

4
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs

@ -52,8 +52,8 @@ public class AbpMongoDbModule : AbpModule
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.IgnoreEventSelectors.Add<OutgoingEventRecord>();
options.IgnoreEventSelectors.Add<IncomingEventRecord>();
options.IgnoredEventSelectors.Add<OutgoingEventRecord>();
options.IgnoredEventSelectors.Add<IncomingEventRecord>();
});
}
}

2
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs

@ -34,7 +34,7 @@ public abstract class EntityChangeEvents_Tests<TStartupModule> : TestAppTestBase
{
services.Configure<AbpDistributedEntityEventOptions>(options =>
{
options.IgnoreEventSelectors.Add<City>();
options.IgnoredEventSelectors.Add<City>();
});
}

Loading…
Cancel
Save