Get all descendants types of base class
- by user1260827
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.