Dumping of "new" property
Is it possible to Dump the new property of the same name of an inherited class?
void Main() { var data = new ChildClass(); ((BaseClass)data).Id = "myentity"; data.Dump(); } public class BaseClass /* generated class so I don't want to modify it */ { public string Id { get; set; } } public class ChildClass : BaseClass { public new Hyperlinq Id => new Hyperlinq($"https://localhost/entities/{base.Id}", base.Id); }
The dump shows the plain string. I would like to show the hyperlink instead. The above is just example I know I can add custom ToDump() implementation but the BaseClass has many properties so I have to effectively duplicate all of them and maintain changes. Would be nice to avoid it.
Comments
Ok, came with relatively usable solution. Still I think the Dump should by default prefer the "new" property value over the base class.
Good call - the member on the derived type should take precedence. This should now be fixed in the 8.3.5 beta:
https://www.linqpad.net/linqpad8.aspx#beta