Source/NFX/DataUtils.cs
/// <summary>
/// If source is not null, creates a shallow clone using 'source.CopyFields(copy)'
/// </summary>
If source is not null, creates a shallow clone using 'source.CopyFields(copy)'
If source is not null creates a shallow clone using ' source . CopyFields ( copy ) '
public static TRow Clone<TRow>(this TRow source,
                                   bool includeAmorphousData = true,
                                   bool invokeAmorphousAfterLoad = true,
                                   Func<string, Schema.FieldDef, bool> fieldFilter = null,
                                   Func<string, string, bool> amorphousFieldFilter = null) where TRow : Row
    {
      if (source==null) return null;
      var copy = Row.MakeRow(source.Schema, source.GetType());
      source.CopyFields(copy, includeAmorphousData, invokeAmorphousAfterLoad, fieldFilter, amorphousFieldFilter);
      return (TRow)copy;
    }
public static TRow Clone < TRow > ( this TRow source , bool includeAmorphousData = true , bool invokeAmorphousAfterLoad = true , Func < string , Schema . FieldDef , bool > fieldFilter = null , Func < string , string , bool > amorphousFieldFilter = null ) where TRow : Row { if ( source == null ) return null ; var copy = Row . MakeRow ( source . Schema , source . GetType ( ) ) ; source . CopyFields ( copy , includeAmorphousData , invokeAmorphousAfterLoad , fieldFilter , amorphousFieldFilter ) ; return ( TRow ) copy ; }
If source is not null, creates a shallow clone using 'source.CopyFields(copy)'
If source is not null creates a shallow clone using ' source . CopyFields ( copy ) '
//must be GetType() not typeof() as we want to clone possibly more derived row as specified by the instance
TRow
this
includeAmorphousData
bool
invokeAmorphousAfterLoad
bool
fieldFilter
Func<string, Schema.FieldDef, bool>
amorphousFieldFilter
Func<string, string, bool>