Table of Contents

Method ReadSchemaFromFile

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

ReadSchemaFromFile(string, ConfigType)

Reads a schema definition from a file and returns an in-memory Schema object.

public Schema ReadSchemaFromFile(string filePath, ConfigType configType)

Parameters

filePath string

Path to a file containing a Velocity schema definition.

configType ConfigType

The format of the configuration file (XML, JSON, or YAML).

Returns

Schema

A populated Schema object representing the database schema.

Examples

using (var m = new Manager())
{
    // Read an XML schema file
    var schema = m.ReadSchemaFromFile("schema.xml", ConfigType.Xml);

    // Read a JSON schema file
    var jsonSchema = m.ReadSchemaFromFile("schema.json", ConfigType.Json);

    // Read a YAML schema file
    var yamlSchema = m.ReadSchemaFromFile("schema.yaml", ConfigType.Yaml);
}

Exceptions

CustomViewCodeCompilationException

Thrown when a custom code-based view does not compile properly.

ColumnNotFoundException

Thrown if any referenced columns do not exist in tables.