public async Task<Cloud> UpdateCloudAsync(Cloud cloud) { if (!clouds.ContainsKey(cloud.Id)) { await cloud.ForceValidate(); clouds[cloud.Id] = cloud; } else { cloud.CopyTo(clouds[cloud.Id]); } return clouds[cloud.Id]; }
public Cloud GetCloud(string cloudId) { if (!clouds.ContainsKey(cloudId)) { var cloud = new Cloud(cloudId); cloud.ForceValidate(); clouds[cloud.Id] = cloud; } else { clouds[cloudId].Validate(); } return clouds[cloudId]; }
public Cloud UpdateCloud(Cloud cloud) { if (!clouds.ContainsKey(cloud.Id)) { cloud.ForceValidate(); clouds[cloud.Id] = cloud; } else { var cacheCloud = clouds[cloud.Id]; cloud.CopyTo(cacheCloud); } return clouds[cloud.Id]; }