Table of Contents

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 EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

entityEntry EntityEntry

The entry for the entity instance on which the property value has changed.

navigation INavigation

The 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

IEnumerable<object>

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

EntityEntry

Navigation

The navigation.

public virtual INavigation Navigation { get; }

Property Value

INavigation

Removed

The entities removed from the collection.

public virtual IEnumerable<object> Removed { get; }

Property Value

IEnumerable<object>