is it possible to have a component resource inheri...
# dotnet
m
is it possible to have a component resource inherit from another component resource? We've got a component resource that we'd like to make some of the methods virtual and overwrite them in a child class, but it looks like it might not be possible, particuarly because we can't register the child class with the component resource class
b
hmm can you expand on issues you're having? I am currently using some abstract component resource classes.
particuarly because we can't register the child class with the component resource class
what do you mean by this?
m
the component resource has as a call to the base pulumi componentresource class to registry the componet e.g. : base("Network:CustomApplicationGateway", name, opts), but if the component resource inherits from another component resource, rather than the base pulumi componentResource class, this won't work because it's not calling that base class
b
sure it can, you just need to pass everything from the derived classes constructor, and interpolate something into the resource type name parameter such that it is different from the parent class