protected virtual ModelRelation CreateModelRelation(DatabaseModel owner) { return new ModelRelation() { Model = owner }; }
protected virtual ModelView CreateModelView(DatabaseModel owner) { return new ModelView() { Model = owner }; }
/// <summary> /// Retrieves the relation with the given schema name and relation name. /// </summary> public static ModelRelation GetRelation(this DatabaseModel model, string schemaName, string name) { return(model.Relations.SingleOrDefault(t => schemaName.Equals(t.Schema, StringComparison.OrdinalIgnoreCase) && name.Equals(t.Name, StringComparison.OrdinalIgnoreCase))); }
protected virtual ModelTable CreateModelTable(DatabaseModel owner) { return new ModelTable() { Model = owner }; }
/// <summary> /// Retrieves the table or view with the given schema name and table/view name. /// </summary> public static ModelTable GetTableOrView(this DatabaseModel model, string schemaName, string name) { return(model.Tables.SingleOrDefault(t => schemaName.Equals(t.Schema, StringComparison.OrdinalIgnoreCase) && name.Equals(t.Name, StringComparison.OrdinalIgnoreCase))); }