// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class Data { public int Iv { get; set; } public String Sv { get; set; } public void Deconstruct(out int xiv, out string xsv) { xiv = Iv; xsv = Sv; } } public class DC8 { public static void Main(string[] args) { Data o = new Data { Iv = 123, Sv = "ABC" }; (int iv, string sv) = o; Console.WriteLine($"{iv} {sv}"); } }