Back to Devexpress

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

expressappframework-404217-debugging-testing-and-error-handling-code-diagnostics-xaf0030.md

latest955 B
Original Source

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

  • Dec 01, 2022

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

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

Valid Code

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