Skip to main content
All docs
V25.1
  • .NET 8.0+

    DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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.v25.1.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