public Artefact GetOrCreate <T>(object instance) { Artefact artefact; if (ContainsKey(instance)) { artefact = FromRef[instance]; } else { artefact = new Artefact(instance); FromRef.Add(instance, artefact); FromId.Add(artefact.Id, artefact); } artefact.StoreInstance(instance, typeof(T)); return(artefact); }
public void Add(KeyValuePair <object, Artefact> item) { FromRef.Add(item.Key, item.Value); FromId.Add(item.Value.Id, item.Value); }
public void Add(object key, Artefact value) { FromRef.Add(key, value); FromId.Add(value.Id, value); }