Get all descendants types of base class

Posted by user1260827 on Stack Overflow See other posts from Stack Overflow or by user1260827
Published on 2012-04-14T05:26:58Z Indexed on 2012/04/14 5:28 UTC
Read the original article Hit count: 199

Filed under:
|

I have a base class called BaseEvent and several descendants classes:

    public class BaseEvent
    {
       // the some properties
       ...
    }

    [MapInheritance(MapInheritanceType.ParentTable)]
    public class Film : BaseEvent
    {
       // the some properties
       ...
    }
    [MapInheritance(MapInheritanceType.ParentTable)]
    public class Concert : BaseEvent
    {
       // the some properties
       ...
    }

I have a code which create the BaseEvent instance at runtime:

BaseEvent event = new BaseEvent();
//assign values for a properties
...    
 baseEvent.XPObjectType = Database.XPObjectTypes.SingleOrDefault(t => t.TypeName == "MyApp.Module.BO.Events.BaseEvent");

Now, this event will be shows in BaseEvent list view.

I want to do the following: when a user click Edit button then show in list view lookup field with all descendants types. And when user saves record change ObjectType to selected value.

How can I do this?
Thanks.

PS. this is asp.net app.

© Stack Overflow or respective owner

Related posts about devexpress

Related posts about xaf