Here is a bit of code
foreach (DataModelObject dmo in allObjects)
{
if (dmo is IResourcePolicy)
{
if (string.Compare(dmo.Name, hostName, true) == 0)
{
IResourcePolicy irp = (IResourcePolicy)dmo;
irp.ResourcePolicy = rp;
irp.AgentPolicyVersion.Version = Convert.ToInt64(policyVersion);
irp.ResourcePolicyEnabled = Convert.ToBoolean(enabled);
irp.AgentVersion = agentVersion;
// Distribute the object without saving it.
SpoServer.Spurt.ServerSendObject(dmo, true, 0);
break;
}
}
}
i want to get executed this statement "irp.AgentVersion = agentVersion;" without executing these three loops " foreach (DataModelObject dmo in allObjects),if (dmo is IResourcePolicy), if (string.Compare(dmo.Name, hostName, true) == 0)",, if these loops are executed then i want to execute the entire four assignment inside the loop including the previous assignment(irp.AgentVersion = agentVersion;) also. Previously its showing none in UI without executing loop,,once executed showing all values,, that we need to change
Can anyone give the code to execute this logic,,IS there "Goto" loop condition checking we can do here