devigned / profile-playground

2 stars 1 forks source link

Child resources type inside parent resource type #15

Open anuchandy opened 7 years ago

anuchandy commented 7 years ago

While going through this https://github.com/devigned/profile-playground/issues/7 another thought came into mind is - for convince we could expose child resource in parent model.

As an example, VirtualMachineExtensions are child resources of VirtualMachine. How about providing following experience -

var vm = client.VirtualMachines.Get(..);
Extension extension = vm.VirtualMachineExtensions.Get("CustomScriptExtension");

extension.PublicSettings.Add(key, value);
await extension.UpdateAsync();

Since extension instance is retrieved from the parent, it knows parentName and resource group so you don't have to pass those parameter while invoking UpdateAsync().

devigned commented 7 years ago

+1

Providing that type of traversal would be awesome!