Skip to main content
A newer version of this page is available. .
All docs
V22.2
.NET Framework 4.5.2+

XAF0030: Use the generic XPCollection<T> class, GetCollection<T> method, and AssociationAttribute without the type parameter to declare your association property

Severity: Warning

Use the generic XPCollection<T> class, GetCollection<T> method, and AssociationAttribute without the type parameter to declare your association property. Current declarations with non-generic XPCollection (.NET 1.0 style) are not recommended and cause issues in Blazor and Web API Service apps.

Examples

Invalid Code

[Association(typeof(SomeXpoType))]
public XPCollection Contacts {
    get { return GetCollection("Contacts"); }
}

Valid Code

[Association]
public XPCollection<SomeXpoType> Contacts {
    get { return GetCollection<SomeXpoType>("Contacts"); }
}
// OR
[Association("SomeName")]
public XPCollection<SomeXpoType> Contacts {
    get { return GetCollection<SomeXpoType>("Contacts"); }
}