// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Linq; namespace WS { public class Data { public int Id { get; set; } public String Val { get; set; } } public class DataService { private List repo = new List(); public Data GetOne(int id) { return repo.First(o => o.Id == id); } public List GetAll() { return repo; } public void Add(Data o) { repo.Add(o); } } }