本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例8: DisposeDatabase
public static void DisposeDatabase(Repository repository)
{
SchemaManager.DropTable(repository, repository.GetCategoryTableName());
}