AzurePoolCrossDbGenerator/Configs.cs
/// <summary>
/// Add missing values from mergeFrom to this.
/// </summary>
/// <param name="mergeFrom"></param>
Add missing values from mergeFrom to this.
Add missing values from mergeFrom to this .
public GenericConfigEntry Merge(GenericConfigEntry mergeFrom, bool overwrite = false)
            {
                Type myType = mergeFrom.GetType();
                FieldInfo[] myField = myType.GetFields();
                foreach (var field in myField)
                {
                    string name = field.Name;
                    string from = (string)myType.GetField(name).GetValue(mergeFrom);
                    string to = (string)myType.GetField(name).GetValue(this);
                    if (to == null || (overwrite && from != null)) myType.GetField(name).SetValue(this, from);
                }
                return this;
            }
public GenericConfigEntry Merge ( GenericConfigEntry mergeFrom , bool overwrite = false ) { Type myType = mergeFrom . GetType ( ) ; FieldInfo [ ] myField = myType . GetFields ( ) ; foreach ( var field in myField ) { string name = field . Name ; string from = ( string ) myType . GetField ( name ) . GetValue ( mergeFrom ) ; string to = ( string ) myType . GetField ( name ) . GetValue ( this ) ; if ( to == null || ( overwrite && from != null ) ) myType . GetField ( name ) . SetValue ( this , from ) ; } return this ; }
Add missing values from mergeFrom to this.
Add missing values from mergeFrom to this .
// get list of public fields // copy values on those with missing values
mergeFrom
GenericConfigEntry
None
overwrite
bool