/// <summary> /// Helper function to convert ps backup container model from service response. /// </summary> public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionContainerResource protectionContainer) { ContainerBase containerModel = null; if (protectionContainer != null && protectionContainer.Properties != null) { if (protectionContainer.Properties.GetType().IsSubclassOf(typeof(ServiceClientModel.IaaSVMContainer))) { containerModel = new AzureVmContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.MabContainer)) { containerModel = new MabContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureSqlContainer)) { containerModel = new AzureSqlContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureStorageContainer)) { containerModel = new AzureFileShareContainer(protectionContainer); } else if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.AzureVMAppContainerProtectionContainer)) { containerModel = new AzureVmWorkloadContainer(protectionContainer); } } return(containerModel); }
/// <summary> /// Helper function to convert ps backup container model from service response. /// </summary> public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionContainerResource protectionContainer) { ContainerBase containerModel = null; if (protectionContainer != null && protectionContainer.Properties != null) { if (protectionContainer.Properties.GetType().IsSubclassOf(typeof(ServiceClientModel.AzureIaaSVMProtectionContainer))) { containerModel = new AzureVmContainer(protectionContainer); } if (protectionContainer.Properties.GetType() == typeof(ServiceClientModel.MabProtectionContainer)) { containerModel = new MabContainer(protectionContainer); } } return(containerModel); }