I'm currently working on a project that has a considerable amount of different product types (more than 200) and in order to solve this I was thinking to build MetaClasses & MetaFields dynamically using the Metadata API.
Since this is an old API I was wondering if it's a safe approach or if EPiServer might remove this API soon (next year or so).
Also, if there is another possible solution to the problem described above, please let me know. Thank you!
I would consider generating the C# classes you need instead, using Roslyn this has become quite simple and clean. You can generate them based on different data sources (JSON, XML, SQL Data etc).
Hope this helps.
I’ve already considered that but I don’t want to end up managing more than 200 classes, product detail pages and so on.
No, the MetaObject/MetaField APIs will not be removed anytime soon. With such important APIs even when we obsolete them, it will take (at least) 12 months + 1 major version to remove them completely.
But do you really need to handle them as distinct types? Where are you using these types you mean?