示例#1
0
        public static string GetConnectionString(this Repository repository)
        {
            var dataPath = new DataPath(repository.Name);
            var dataFile = Path.Combine(dataPath.PhysicalPath, repository.Name + ".sdf");

            var connectionString = string.Format("Data Source={0};Persist Security Info=False;", dataFile);
            if (!File.Exists(dataFile))
            {
                DatabaseHelper.CreateDatabase(dataFile, connectionString);
                SchemaManager.InitializeDatabase(repository);
            }
            return connectionString;
        }
示例#2
0
 public static string GetCategoryDataFile(this Repository repository)
 {
     DataPath dataPath = new DataPath(repository.Name);
     return Path.Combine(dataPath.PhysicalPath, "_category_" + ".xml");
 } 
示例#3
0
 public static string GetContentFile(this Schema schema)
 {
     DataPath dataPath = new DataPath(schema.Repository.Name);
     return Path.Combine(dataPath.PhysicalPath, schema.Name + ".xml");
 }