public SampleItem Update(int id, SampleItem instance) { // Update the given instance of SampleItem in the collection SampleItem item; if (Database.Items.TryGetValue(id, out item)) { item.StringValue = instance.StringValue; } return instance; }
public SampleItem Create(SampleItem instance) { // Add the new instance of SampleItem to the collection Database.Items.Add(instance.Id, instance); return Database.Items[instance.Id]; }