public ISimpleDbSchema LoadSimpleSchemaXml(string path) { string fullPath = Path.GetFullPath(path); WeakReference result; if (_schemaCache.TryGetValue(fullPath, out result) && result.IsAlive) { return((ISimpleDbSchema)result.Target); } using (var stream = File.OpenRead(fullPath)) { var schema = SimpleDbSchema.FromXml(stream); _schemaCache[fullPath] = new WeakReference(schema); return(schema); } }
public ISimpleDbSchema GetSimpleSchemaXml(string xml) { return(SimpleDbSchema.FromXml(xml)); }