mardi 26 juillet 2022

in C#, check for Null or Empty Properties in one object and Populate from another object

I have three different objects of same class with some properties missing in one whereas available in other. Now, I want to write a function which if finds empty or null property in one object, gets data for the same property from second object and so on up to three different objects. I want to write a generic method since there are multiple classes where I need to implement it. The return type should have all the properties with values populated from any of the three objects where these are not empty.

Any suggestions would be appreciated.





Aucun commentaire:

Enregistrer un commentaire