Class CollectionChangedEventData
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.dll
A DiagnosticSource event payload class for events that indicate a collection navigation property has had entities added and/or removed.
public class CollectionChangedEventData : NavigationEventData, INavigationBaseEventData, ICollectionChangedEventData
- Inheritance
-
CollectionChangedEventData
- Implements
- Inherited Members
Remarks
See Logging, events, and diagnostics for more information and examples.
Constructors
CollectionChangedEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, EntityEntry, INavigation, IEnumerable<object>, IEnumerable<object>)
Constructs the event payload.
public CollectionChangedEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, EntityEntry entityEntry, INavigation navigation, IEnumerable<object> added, IEnumerable<object> removed)
Parameters
eventDefinition
EventDefinitionBaseThe event definition.
messageGenerator
Func<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
entityEntry
EntityEntryThe entry for the entity instance on which the property value has changed.
navigation
INavigationThe navigation property.
added
IEnumerable<object>The entities added to the collection.
removed
IEnumerable<object>The entities removed from the collection.
Properties
Added
The entities added to the collection.
public virtual IEnumerable<object> Added { get; }
Property Value
EntityEntry
The entry for the entity instance on which the navigation property has been added to or removed from.
public virtual EntityEntry EntityEntry { get; }
Property Value
Navigation
The navigation.
public virtual INavigation Navigation { get; }
Property Value
Removed
The entities removed from the collection.
public virtual IEnumerable<object> Removed { get; }