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
filePathstringPath to a file containing a Velocity schema definition.
configTypeConfigTypeThe format of the configuration file (XML, JSON, or YAML).
Returns
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.