I agree with others: you should not use C ++ / CLI in most cases, you should use C # (or another "normal" managed language) for this (if you want to write a .Net application). C ++ / CLI is useful mainly in special circumstances, for example, in the interaction between managed and unmanaged code.
If you are sure you want to use the C ++ / CLI, you cannot put your own classes in the managed ones. But you can put pointers to native classes:
ref class Recipe{ private: string* partsName; vector<Iingredient>* ing; };
The code above is executed. But you should keep in mind that these are ordinary C ++ native pointers, which means that you need to manually delete them. To make this property, you should read about how destructors and finalizers work in C ++ / CLI.
svick source share