mercredi 27 novembre 2019

Create object by merging other three with priority (C# .NET 3.5)

I have three C# (using .NET 3.5 for a legacy sw) objects of the same class (A, B, C) that has all public properties (string, int, short, byte, datetime, double) I need to create a fourth (D) by merging the "three" objects. If A has a property set (not null or empty) I have to set it in D, otherwise I have to check B and then as last C. What's the most effective and elegant way to do it? I've read about Reflection is that the right way?





Aucun commentaire:

Enregistrer un commentaire