Source/NFX/DataAccess/CRUD/Schema.cs
/// <summary>
/// Writes fielddef as JSON. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class
/// </summary>
Writes fielddef as JSON. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class
Writes fielddef 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)
                {
                    var attr = this[null];
                    if (attr != null && attr.NonUI)
                    {
                      wri.Write("{}");
                      return;
                    }
                    bool typeIsNullable;
                    string tp = JSONMappings.MapCLRTypeToJSON(m_Type, out typeIsNullable);
                    var map = new Dictionary<string, object>
                    {
                      {"Name",  m_Name},
                      {"Order", m_Order},
                      {"Type",  tp},
                      {"Nullable", typeIsNullable}
                    };
                    if (attr!=null)
                    {
                        map.Add("IsKey", attr.Key);
                        map.Add("IsRequired", attr.Required);
                        map.Add("Visible", attr.Visible);
                        if (attr.Default!=null)map.Add("Default", attr.Default);
                        if (attr.CharCase!=CharCase.AsIs) map.Add("CharCase", attr.CharCase);
                        if (attr.Kind!=DataKind.Text) map.Add("Kind", attr.Kind);
                        if (attr.MinLength!=0) map.Add("MinLen", attr.MinLength);
                        if (attr.MaxLength!=0) map.Add("MaxLen", attr.MaxLength);
                        if (attr.Min!=null) map.Add("Min", attr.Min);
                        if (attr.Max!=null) map.Add("Max", attr.Max);
                        if (attr.ValueList!=null) map.Add("ValueList", attr.ValueList);
                        if (attr.Description!=null)map.Add("Description", attr.Description);
                    }
                    JSONWriter.WriteMap(wri, map, nestingLevel, options);
                }
public void WriteAsJSON ( System . IO . TextWriter wri , int nestingLevel , JSONWritingOptions options = null ) { var attr = this [ null ] ; if ( attr != null && attr . NonUI ) { wri . Write ( " " ) ; return ; } bool typeIsNullable ; string tp = JSONMappings . MapCLRTypeToJSON ( m_Type , out typeIsNullable ) ; var map = new Dictionary < string , object > { { " " , m_Name } , { " " , m_Order } , { " " , tp } , { " " , typeIsNullable } } ; if ( attr != null ) { map . Add ( " " , attr . Key ) ; map . Add ( " " , attr . Required ) ; map . Add ( " " , attr . Visible ) ; if ( attr . Default != null ) map . Add ( " " , attr . Default ) ; if ( attr . CharCase != CharCase . AsIs ) map . Add ( " " , attr . CharCase ) ; if ( attr . Kind != DataKind . Text ) map . Add ( " " , attr . Kind ) ; if ( attr . MinLength != 0 ) map . Add ( " " , attr . MinLength ) ; if ( attr . MaxLength != 0 ) map . Add ( " " , attr . MaxLength ) ; if ( attr . Min != null ) map . Add ( " " , attr . Min ) ; if ( attr . Max != null ) map . Add ( " " , attr . Max ) ; if ( attr . ValueList != null ) map . Add ( " " , attr . ValueList ) ; if ( attr . Description != null ) map . Add ( " " , attr . Description ) ; } JSONWriter . WriteMap ( wri , map , nestingLevel , options ) ; }
Writes fielddef as JSON.
Writes fielddef as JSON .
//nothing to write for NONUI //metadata content is in the internal format and not dumped
wri
System.IO.TextWriter
nestingLevel
int
options
JSONWritingOptions