Skip to main content
.NET 6.0+

Collection Properties in EF Core

The example below illustrates how to implement Collection Properties in an EF Core class.

public virtual IList<AssociatedObject> Association { get; set; } = new ObservableCollection<AssociatedObject>();
[DevExpress.ExpressApp.DC.AggregatedAttribute]
public virtual IList<AggregatedObject> AggregatedAssociation { get; set; } = new ObservableCollection<AssociatedObject>();

Note that collection properties should be declared as virtual in EF Core.

See Also