This message was deleted.
# general
s
This message was deleted.
l
I always avoid this by passing only the required IDs around (the IDs of the constituent resources). But in theory you could either marshal and unmarshal the ComponentResource youself, or provide a "read-only" flag and write code that gets all the constituent resources, instead of newing them.
However, there is no built-in way of doing this.
(If someone were to write a general-purpose typescript marshaller/unmarshaller and come up with a nice pattern to choose between newing and unmarshalling, I know I'd use it!)
l
If I understand correctly you are suggesting returning "native" ID of the created resource and using GetXyz to retrieve the resource elsewhere.
l
Yes, that's one way of doing it. Or just storing the IDs, and deferring retrieving until it's actually needed. It often isn't: in a lot of cases, only the IDs of the resources are ever used.