Source/NFX/DataAccess/CRUD/Row.cs
/// <summary>
/// Writes default values specified in schema into fields.
/// Pass overwrite=true to force defaults over non-null existing values (false by default)
/// </summary>
Writes default values specified in schema into fields.
Pass overwrite=true to force defaults over non-null existing values (false by default)
Writes default values specified in schema into fields . Pass overwrite = true to force defaults over non - null existing values ( false by default )
public void ApplyDefaultFieldValues(string targetName = null, bool overwrite = false)
            {
              foreach(var fdef in  Schema)
              {
                var attr = fdef[targetName];
                if (attr==null) continue;
                if (attr.Default!=null)
                 if (overwrite || this.GetFieldValue(fdef)==null)
                  this.SetFieldValue(fdef, attr.Default);
              }
            }
public void ApplyDefaultFieldValues ( string targetName = null , bool overwrite = false ) { foreach ( var fdef in Schema ) { var attr = fdef [ targetName ] ; if ( attr == null ) continue ; if ( attr . Default != null ) if ( overwrite || this . GetFieldValue ( fdef ) == null ) this . SetFieldValue ( fdef , attr . Default ) ; } }
Writes default values specified in schema into fields.
Writes default values specified in schema into fields .
targetName
string
overwrite
bool