public static void Main()
VirtualMan vmWithoutName = new VirtualMan()
InstanceType = "Beginner",
VirtualMan vmName = new VirtualMan()
InstanceType = "Beginner",
Console.WriteLine("-----Without Name---");
var str = vmWithoutName.Name != null ? string.Format("name is {0} ", vmWithoutName.Name) : string.Empty;
Console.WriteLine(string.Format("VM {0}ID is {1}. State is: {2}. Location: {3} and the Instance Type is {4}. Key is {5}.",
str, vmWithoutName.InstanceId, vmWithoutName.State, vmWithoutName.Region, vmWithoutName.InstanceType, vmWithoutName.KeyName));
Console.WriteLine("\n\n-----With Name---");
var str1 = vmName.Name != null ? string.Format("name is {0} ", vmName.Name) : string.Empty;
Console.WriteLine(string.Format("VM {0}ID is {1}. State is: {2}. Location: {3} and the Instance Type is {4}. Key is {5}.",
str1, vmName.InstanceId, vmName.State, vmName.Region, vmName.InstanceType, vmName.KeyName));
public string InstanceId { get; set; }
public string Name { get; set; }
public string State { get; set; }
public string Region { get; set; }
public string InstanceType { get; set; }
public string KeyName { get; set; }