Source/NFX/DataAccess/CRUD/Schema.cs
/// <summary>
/// Writes schema as JSON. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class
/// </summary>
Writes schema as JSON. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class
Writes schema as JSON . Do not call this method directly instead call rowset . ToJSON () or use JSONWriter class
public void WriteAsJSON(System.IO.TextWriter wri, int nestingLevel, JSONWritingOptions options = null)
            {
                IEnumerable<FieldDef> defs = m_FieldDefs;
                if (options!=null && options.RowMapTargetName.IsNotNullOrWhiteSpace())
                {
                  var newdefs = new List<FieldDef>();
                  foreach(var def in defs)
                  {
                     FieldAttribute attr;
                     var name = def.GetBackendNameForTarget(options.RowMapTargetName, out attr);
                     if (attr!=null)
                     {
                       if(attr.StoreFlag==StoreFlag.None || attr.StoreFlag==StoreFlag.OnlyLoad)
                       {
                        continue;
                       }
                     }
                     newdefs.Add(def);
                  }
                  defs = newdefs;
                }
                var map = new Dictionary<string, object>
                {
                  {"Name", "JSON"+m_Name.GetHashCode()},
                  {"FieldDefs", defs}
                };
                JSONWriter.WriteMap(wri, map, nestingLevel, options);
            }
public void WriteAsJSON ( System . IO . TextWriter wri , int nestingLevel , JSONWritingOptions options = null ) { IEnumerable < FieldDef > defs = m_FieldDefs ; if ( options != null && options . RowMapTargetName . IsNotNullOrWhiteSpace ( ) ) { var newdefs = new List < FieldDef > ( ) ; foreach ( var def in defs ) { FieldAttribute attr ; var name = def . GetBackendNameForTarget ( options . RowMapTargetName , out attr ) ; if ( attr != null ) { if ( attr . StoreFlag == StoreFlag . None || attr . StoreFlag == StoreFlag . OnlyLoad ) { continue ; } } newdefs . Add ( def ) ; } defs = newdefs ; } var map = new Dictionary < string , object > { { " " , " " + m_Name . GetHashCode ( ) } , { " " , defs } } ; JSONWriter . WriteMap ( wri , map , nestingLevel , options ) ; }
Writes schema as JSON.
Writes schema as JSON .
wri
System.IO.TextWriter
nestingLevel
int
options
JSONWritingOptions