Source/NFX/DataAccess/CRUD/Attributes.cs
/// <summary>
/// Parses content with or without root node
/// </summary>
Parses content with or without root node
Parses content with or without root node
public static ConfigSectionNode ParseMetadataContent(string content)
        {
          try
          {
              content = content ?? string.Empty;
              var root = ("metadata{"+content+"}").AsLaconicConfig(handling: ConvertErrorHandling.Throw);
              if (!root.HasAttributes && root.Children.Count()==1)
              {
                var subroot = root["metadata"];
                if (subroot.Exists) return subroot;
              }
              return root;
          }
          catch(Exception error)
          {
              throw new DataAccessException(StringConsts.CRUD_FIELD_ATTR_METADATA_PARSE_ERROR.Args(error.ToMessageWithType(), content), error);
          }
        }
public static ConfigSectionNode ParseMetadataContent ( string content ) { try { content = content ?? string . Empty ; var root = ( " " + content + " " ) . AsLaconicConfig ( handling : ConvertErrorHandling . Throw ) ; if ( ! root . HasAttributes && root . Children . Count ( ) == 1 ) { var subroot = root [ " " ] ; if ( subroot . Exists ) return subroot ; } return root ; } catch ( Exception error ) { throw new DataAccessException ( StringConsts . CRUD_FIELD_ATTR_METADATA_PARSE_ERROR . Args ( error . ToMessageWithType ( ) , content ) , error ) ; } }
Parses content with or without root node
Parses content with or without root node
//Unwrap extra "metadata" root node
content
string