Skip to main content
All docs
V24.2
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XAF0015: Association must not have the Aggregated attribute if it is paired to the "many" end of the association

  • 2 minutes to read

Severity: Warning

Many-to-Many associations must not have Aggregated attribute on any ends. One-to-Many associations must not have Aggregated attribute on “one” ends.

#Examples

#Invalid Code

using DevExpress.ExpressApp;

namespace MySolution.Module.BusinessObjects { 
    [Persistent]
    public class OneToManyAssociationBothAggregated {
        // One-to-Many association should not have Aggregated attribute on "one" end
        [Association, Aggregated]
        public OneToManyAssociationBothAggregated Parent { 
            get { ... }
            set { ... } 
        }

        [Association, Aggregated]
        public XPCollection<OneToManyAssociationBothAggregated> Children { 
            get { ... } 
        }
    }

    [Persistent]
    public class ManyToManyAssociationBothAggregated {
        // Many-to-Many association should not have Aggregated attribute on any end
        [Association, Aggregated]
        public XPCollection<ManyToManyAssociationBothAggregated> Friends { 
            get { ... }
            set { ... } 
        }

        // Many-to-Many association should not have Aggregated attribute on any end
        [Association, Aggregated]
        public XPCollection<ManyToManyAssociationBothAggregated> Colleagues { 
            get { ... }
            set { ... } 
        }
    }
}

#Valid Code

using DevExpress.ExpressApp;

namespace MySolution.Module.BusinessObjects {
    [Persistent]
    public class OneToOneAssociationBothAggregated : BaseObject {
        [Association, Aggregated]
        public OneToOneAssociationBothAggregated PropertyOne { 
            get { ... }
            set { ... } 
        }

        [Association, Aggregated]
        public OneToOneAssociationBothAggregated PropertyTwo { 
            get { ... }
            set { ... } 
        }
    }

    [Persistent]
    public class OneToManyAssociationManyAggregated : BaseObject {
        [Association]
        public OneToManyAssociationManyAggregated Parent { 
            get { ... }
            set { ... } 
        }

        [Association, Aggregated]
        public XPCollection<OneToManyAssociationManyAggregated> Children { 
            get { ... }
        }
    }
}