MemberJunction / MJ

Main MemberJunction Repository
https://docs.memberjunction.org/
ISC License
5 stars 0 forks source link

Strongly Typed Datasets #428

Open AN-BC opened 4 months ago

AN-BC commented 4 months ago

It would be nice for CodeGen to generate objects that are strongly typed for a given dataset. The way this might work would be to generate objects where for a given Dataset, each DatasetItem is a property of a strongly typed array, and each of the items in the array is of the BaseEntity derived sub-class for the given entity for that DatasetItem.

This could be used for returning results of Datasets that are strongly typed which would be very nice for various programming scenarios.

To implement this we would probably create a new package called CoreDatasets and another one called GeneratedDatasets like we do for Entities and Actions, and in those packages we would output the results from the above.

An example class might be something like:

class Communication_Metadata { BaseMessageTypes: CommunicationBaseMessageTypeEntity[], Providers: CommunicationProviderEntityExtended[], ProviderMessageTypes: CommunicationProviderMessageTypeEntity[] }

AN-BC commented 2 months ago

@cadam11 - curious what you think of this idea