Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

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

IntermediateObjectAttribute Class

Applies to classes. Marks the class as an intermediate in the many-to-many relationship declared with ManyToManyAliasAttribute.

Namespace: DevExpress.ExpressApp.Security

Assembly: DevExpress.ExpressApp.Security.v24.2.dll

#Declaration

[AttributeUsage(AttributeTargets.Class)]
public class IntermediateObjectAttribute :
    Attribute

#Remarks

The following example demonstrates how to apply this attribute:

using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.Base;
using DevExpress.Xpo;
using System.Collections.Generic;
using System.ComponentModel;
// ...
[DefaultClassOptions]
public class Contact : XPObject {
    // ...
    [Browsable(false)]
    [Association("Contact-ContactTasks"), Aggregated]
    public XPCollection<ContactTask> ContactTasks { 
        get { return GetCollection<ContactTask>(nameof(ContactTasks)); } }
    [ManyToManyAlias(nameof(ContactTasks), nameof(ContactTask.Task))]
    public IList<Task> TaskCollection {
        get { return GetList<Task>(nameof(TaskCollection)); }
    }
}
[DefaultClassOptions]
public class Task : XPObject {
    // ...
    [Browsable(false)]
    [Association("Task-ContactTasks"), Aggregated]
    public XPCollection<ContactTask> ContactTasks { 
        get { return GetCollection<ContactTask>(nameof(ContactTasks)); } }
    [ManyToManyAlias(nameof(ContactTasks), nameof(ContactTask.Contact))]
    public IList<Contact> ContactCollection {
        get { return GetList<Contact>(nameof(ContactCollection)); }
    }
}
[IntermediateObject(nameof(Contact), nameof(Task))]
public class ContactTask : XPObject {
    public ContactTask(Session session) : base(session) { }
    Contact fContact;
    [Association("Contact-ContactTasks")]
    public Contact Contact {
        get { return fContact; }
        set { SetPropertyValue<Contact>(nameof(Contact), ref fContact, value); }
    }
    Task fTask;
    [Association("Task-ContactTasks")]
    public Task Task {
        get { return fTask; }
        set { SetPropertyValue<Task>(nameof(Task), ref fTask, value); }
    }
}

#Inheritance

Object
Attribute
IntermediateObjectAttribute
See Also