// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) public class T1 { public int F1 { get; set; } public string F2 { get; set; } public T1() : this(0, "") { } public T1(int f1, string f2) { this.F1 = f1; this.F2 = f2; } } public class Test { public T1 GetOne(int f1) { // dummy implementation return new T1(f1, "getOne"); } public T1[] GetAll() { // dummy implementation T1[] res = new T1[3]; res[0] = new T1(1, "getAll #1"); res[1] = new T1(2, "getAll #2"); res[2] = new T1(3, "getAll #3"); return res; } public T1[] GetSome(int start, int finish) { // dummy implementation T1[] res = new T1[finish - start + 1]; for(int i = 0; i < res.Length; i++) { res[i] = new T1(start + i, "getSome #" + (start + i)); } return res; } public bool Save(T1 o) { // dummy implementation return o.F1 > 0 && o.F2.Length > 0; } public bool Delete(int f1) { // dummy implementation return f1 > 0; } }