当前位置: 首页>>代码示例>>C#>>正文


C# Repository.GetCategoryTableName方法代码示例

本文整理汇总了C#中Kooboo.CMS.Content.Models.Repository.GetCategoryTableName方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.GetCategoryTableName方法的具体用法?C# Repository.GetCategoryTableName怎么用?C# Repository.GetCategoryTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kooboo.CMS.Content.Models.Repository的用法示例。


在下文中一共展示了Repository.GetCategoryTableName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddCategory

        public MySqlCommand AddCategory(Repository repository, Category category)
        {
            string sql = string.Format("INSERT INTO `{0}`(UUID,CategoryFolder,CategoryUUID) VALUES(?UUID,?CategoryFolder,?CategoryUUID)"
                , repository.GetCategoryTableName());
            MySqlCommand command = new MySqlCommand();
            command.CommandText = sql;
            command.Parameters.Add(new MySqlParameter("?UUID", category.ContentUUID));
            command.Parameters.Add(new MySqlParameter("?CategoryFolder", category.CategoryFolder));
            command.Parameters.Add(new MySqlParameter("?CategoryUUID", category.CategoryUUID));

            return command;
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:12,代码来源:TextContentDbCommands.cs

示例2: GetCategoryClause

        private IEnumerable<string> GetCategoryClause(Repository repository, IEnumerable<IContentQuery<TextContent>> categoryQueries, List<Parameter> parameters)
        {
            TextContentTranslator translator = new TextContentTranslator();
            List<string> categoryQueryList = new List<string>();
            foreach (var categoryQuery in categoryQueries)
            {
                var executor = translator.Translate(categoryQuery);
                var categoryVisitor = new MysqlVisitor<TextContent>(parameters);
                categoryVisitor.Visite(categoryQuery.Expression);

                IEnumerable<Parameter> outParameters;
                var categoryQuerySQL = executor.BuildQuerySQL(categoryVisitor, out outParameters);

                categoryQueryList.Add(string.Format(@"EXISTS(
                        SELECT ContentCategory.CategoryUUID
                            FROM `{0}` ContentCategory,
                                ({1})category
                            WHERE content.UUID = ContentCategory.UUID AND ContentCategory.CategoryUUID = category.UUID
                      )", repository.GetCategoryTableName()
                        , categoryQuerySQL));

            }
            return categoryQueryList;
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:24,代码来源:SimpleQueryExecutor.cs

示例3: DeleteCategory

        public SqlCommand DeleteCategory(Repository repository, Category category)
        {
            string sql = string.Format("DELETE FROM [{0}] WHERE [email protected] AND [email protected] AND [email protected]"
                 , repository.GetCategoryTableName());
            SqlCommand command = new SqlCommand();
            command.CommandText = sql;
            command.Parameters.Add(new SqlParameter("@UUID", category.ContentUUID));
            command.Parameters.Add(new SqlParameter("@CategoryFolder", category.CategoryFolder));
            command.Parameters.Add(new SqlParameter("@CategoryUUID", category.CategoryUUID));

            return command;
        }
开发者ID:Godoy,项目名称:CMS,代码行数:12,代码来源:TextContentDbCommands.cs

示例4: CreateCategoryTable

        private static void CreateCategoryTable(Repository repository)
        {
            string ddl = string.Format(@"
    CREATE TABLE IF NOT EXISTS `{0}` (	
	    `UUID` nvarchar(36) NOT NULL,
	    `CategoryFolder` nvarchar(256),
	    `CategoryUUID` nvarchar(36)
	    )DEFAULT CHARSET={1};", repository.GetCategoryTableName(), MysqlSettings.Instance.DEFAULT_CHARSET);
            ExecuteDDL(repository, ddl);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:10,代码来源:SchemaManager.cs

示例5: ExportCategoryData

 public IEnumerable<Category> ExportCategoryData(Repository repository)
 {
     var connectionString = repository.GetConnectionString();
     string sql = string.Format("SELECT UUID,CategoryFolder,CategoryUUID FROM [{0}] ", repository.GetCategoryTableName());
     List<Category> list = new List<Category>();
     SqlCeConnection connection;
     using (var reader = SQLCeHelper.ExecuteReader(connectionString, new SqlCeCommand() { CommandText = sql }, out connection))
     {
         try
         {
             while (reader.Read())
             {
                 Category category = new Category();
                 category.ContentUUID = reader.GetString(0);
                 category.CategoryFolder = reader.GetString(1);
                 category.CategoryUUID = reader.GetString(2);
                 list.Add(category);
             }
         }
         finally
         {
             reader.Close();
             connection.Close();
         }
     }
     return list;
 }
开发者ID:jason1234,项目名称:CMS,代码行数:27,代码来源:TextContentProvider.cs

示例6: CreateCategoryTable

 private static void CreateCategoryTable(Repository repository)
 {
     string ddl = string.Format(@"CREATE TABLE [{0}] (
     UUID nvarchar(36) NOT NULL,
     CategoryFolder nvarchar(256),
     CategoryUUID nvarchar(36)
     );", repository.GetCategoryTableName());
     ExecuteDDL(repository, ddl);
 }
开发者ID:Epitomy,项目名称:CMS,代码行数:9,代码来源:SchemaManager.cs

示例7: ExportCategoryData

 public IEnumerable<Category> ExportCategoryData(Repository repository)
 {
     string sql = string.Format("SELECT UUID,CategoryFolder,CategoryUUID FROM `{0}` ", repository.GetCategoryTableName());
     List<Category> list = new List<Category>();
     MySqlConnection connection;
     using (var reader = MysqlHelper.ExecuteReader(repository, new MySqlCommand() { CommandText = sql }, out connection))
     {
         while (reader.Read())
         {
             Category category = new Category();
             category.ContentUUID = reader.GetString(0);
             category.CategoryFolder = reader.GetString(1);
             category.CategoryUUID = reader.GetString(2);
             list.Add(category);
         }
         connection.Close();
     }
     return list;
 }
开发者ID:Godoy,项目名称:CMS,代码行数:19,代码来源:TextContentProvider.cs

示例8: DisposeDatabase

 public static void DisposeDatabase(Repository repository)
 {
     SchemaManager.DropTable(repository, repository.GetCategoryTableName());
 }
开发者ID:Epitomy,项目名称:CMS,代码行数:4,代码来源:DatabaseHelper.cs


注:本文中的Kooboo.CMS.Content.Models.Repository.GetCategoryTableName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。