private void SetAllValues(ConnectionInfoInheritance otherInheritanceObject) { var properties = GetProperties(); foreach (var property in properties) { var newPropertyValue = property.GetValue(otherInheritanceObject, null); property.SetValue(this, newPropertyValue, null); } }