public void AddProperty(PocoArtifact pocoArtifact, string name, object value) { IEnumerable<IArtifact> artifacts = cloud.getArtifacts().Where(a => a.Id == pocoArtifact.Id); if (artifacts.Count() == 1) { IArtifact artifact = artifacts.First(); cloud.createProperty(artifact, name, value); } }
public IList<PocoProperty> GetProperties(PocoArtifact pocoArtifact) { IEnumerable<IArtifact> artifacts = cloud.getArtifacts().Where(a => a.Id == pocoArtifact.Id); if (artifacts.Count() == 1) { IArtifact artifact = artifacts.First(); IList<PocoProperty> pocos = new List<PocoProperty>(); foreach (IProperty property in artifact.Properties) { PocoArtifact pocoParent = new PocoArtifact(property.Parent.Id); pocos.Add(new PocoProperty(pocoParent, property.Name, property.Value)); } return pocos; } else { return null; } }
public PocoArtifact CreateArtifact() { IArtifact artifact = cloud.createArtifact(); PocoArtifact poco = new PocoArtifact(artifact.Id); return poco; }
public PocoProperty(PocoArtifact parent, string name, object value) { _parent = parent; _name = name; _value = value; }