public record DaRecord(string Message, int Value)
public void Set(string name, object newValue)
var prop = typeof(DaRecord).GetProperty(name);
prop.SetValue(this, newValue);
public static void Main()
var a = new DaRecord("Secret", 4);
a.Set("Message", "New secret");
Console.WriteLine("A: " + a);
Console.WriteLine("B: " + b);
Console.WriteLine("C: " + c);