Method ValidateSchema
- Namespace
- YndigoBlue.Velocity.Engine
- Assembly
- YndigoBlue.Velocity.dll
ValidateSchema(Schema)
Validates that a schema definition matches the actual schema structure in the database.
public bool ValidateSchema(Schema schema)
Parameters
Returns
- bool
True if the schema matches the database structure; false otherwise.
Examples
using (var m = new Manager(conn))
{
// Load schema from file
var expectedSchema = m.ReadSchemaFromFile("schema.xml", ConfigType.Xml);
// Validate against database
bool isValid = m.ValidateSchema(expectedSchema);
if (isValid)
Console.WriteLine("Schema matches database");
else
Console.WriteLine("Schema does not match database");
}
Exceptions
- DbException
Thrown when a database error occurs.