Source/NFX/DataAccess/CRUD/Row.cs
/// <summary>
/// Override to filter-out some fields from serialization to JSON, or change field values.
/// Return name null to indicate that field should be filtered-out(excluded from serialization to JSON)
/// </summary>
Override to filter-out some fields from serialization to JSON, or change field values.
Return name null to indicate that field should be filtered-out(excluded from serialization to JSON)
Override to filter - out some fields from serialization to JSON or change field values . Return name null to indicate that field should be filtered - out ( excluded from serialization to JSON )
protected virtual object FilterJSONSerializerField(Schema.FieldDef def, JSONWritingOptions options, out string name)
            {
              var tname = options!=null ? options.RowMapTargetName : null;
              if (tname.IsNotNullOrWhiteSpace())
              {
                FieldAttribute attr;
                name = def.GetBackendNameForTarget(tname, out attr);
                if (attr!=null)
                {
                  if(attr.StoreFlag==StoreFlag.None || attr.StoreFlag==StoreFlag.OnlyLoad)
                  {
                    name = null;
                    return null;
                  }
                  var dflt = attr.Default;
                  if (dflt!=null)
                  {
                    var value = GetFieldValue(def);
                    if (dflt.Equals(value))
                    {
                      name = null;
                      return null;
                    }
                    return value;
                  }
                }
              }
              else
                name = def.Name;
              return name.IsNotNullOrWhiteSpace() ? GetFieldValue(def) : null;
            }
protected virtual object FilterJSONSerializerField ( Schema . FieldDef def , JSONWritingOptions options , out string name ) { var tname = options != null ? options . RowMapTargetName : null ; if ( tname . IsNotNullOrWhiteSpace ( ) ) { FieldAttribute attr ; name = def . GetBackendNameForTarget ( tname , out attr ) ; if ( attr != null ) { if ( attr . StoreFlag == StoreFlag . None || attr . StoreFlag == StoreFlag . OnlyLoad ) { name = null ; return null ; } var dflt = attr . Default ; if ( dflt != null ) { var value = GetFieldValue ( def ) ; if ( dflt . Equals ( value ) ) { name = null ; return null ; } return value ; } } } else name = def . Name ; return name . IsNotNullOrWhiteSpace ( ) ? GetFieldValue ( def ) : null ; }
Override to filter-out some fields from serialization to JSON, or change field values.
Override to filter - out some fields from serialization to JSON or change field values .
def
Schema.FieldDef
options
JSONWritingOptions
string
out