Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 public ISimpleDbSchema GetSimpleSchemaXml(string xml)
 {
     return(SimpleDbSchema.FromXml(xml));
 }