Browse Source
Rename IgnoreEventSelectors to IgnoredEventSelectors.
pull/22471/head
maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
6 changed files with
10 additions and
10 deletions
docs/en/framework/infrastructure/event-bus/distributed/index.md
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs
@ -299,12 +299,12 @@ Configure<AbpDistributedEntityEventOptions>(options =>
);
//Ignore for a single entity
options.IgnoreEventSelectors.Add< IgnoreProduct > ();
options.Ignored EventSelectors.Add< Ignored ProductEntity > ();
});
````
* 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 `Ignored EventSelectors` 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,14 +4,14 @@ public class AbpDistributedEntityEventOptions
{
public IAutoEntityDistributedEventSelectorList AutoEventSelectors { get ; }
public IAutoEntityDistributedEventSelectorList IgnoreEventSelectors { get ; }
public IAutoEntityDistributedEventSelectorList Ignored EventSelectors { get ; }
public EtoMappingDictionary EtoMappings { get ; set ; }
public AbpDistributedEntityEventOptions ( )
{
AutoEventSelectors = new AutoEntityDistributedEventSelectorList ( ) ;
IgnoreEventSelectors = new AutoEntityDistributedEventSelectorList ( ) ;
Ignored EventSelectors = new AutoEntityDistributedEventSelectorList ( ) ;
EtoMappings = new EtoMappingDictionary ( ) ;
}
}
@ -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 . Ignored EventSelectors . IsMatch ( entityType ) & &
DistributedEntityEventOptions . AutoEventSelectors . IsMatch ( entityType ) ;
}
@ -32,8 +32,8 @@ public class AbpEntityFrameworkCoreModule : AbpModule
Configure < AbpDistributedEntityEventOptions > ( options = >
{
options . IgnoreEventSelectors . Add < OutgoingEventRecord > ( ) ;
options . IgnoreEventSelectors . Add < IncomingEventRecord > ( ) ;
options . Ignored EventSelectors . Add < OutgoingEventRecord > ( ) ;
options . Ignored EventSelectors . Add < IncomingEventRecord > ( ) ;
} ) ;
}
}
@ -52,8 +52,8 @@ public class AbpMongoDbModule : AbpModule
Configure < AbpDistributedEntityEventOptions > ( options = >
{
options . IgnoreEventSelectors . Add < OutgoingEventRecord > ( ) ;
options . IgnoreEventSelectors . Add < IncomingEventRecord > ( ) ;
options . Ignored EventSelectors . Add < OutgoingEventRecord > ( ) ;
options . Ignored EventSelectors . Add < IncomingEventRecord > ( ) ;
} ) ;
}
}
@ -34,7 +34,7 @@ public abstract class EntityChangeEvents_Tests<TStartupModule> : TestAppTestBase
{
services . Configure < AbpDistributedEntityEventOptions > ( options = >
{
options . IgnoreEventSelectors . Add < City > ( ) ;
options . Ignored EventSelectors . Add < City > ( ) ;
} ) ;
}