This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// copies the properties with the same name and type from the objectFrom to the objectTo. | |
/// Beware, it uses reflection, so it can be slow for certain scenarios | |
/// </summary> | |
public static void CopyObjectPropertyValues(object objectFrom, object objectTo) | |
{ | |
var propertiesFrom = objectFrom.GetType().GetProperties(); | |
var propertiesTo = objectTo.GetType().GetProperties(); | |
foreach (var propFrom in propertiesFrom) |