using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Datory;

namespace GxPress.Repository.Interface.Category
{
    /// <summary>
    /// 类别
    /// </summary>
    public interface ICategoryRepository:IRepository
    {
        Task<Entity.tede2.Category.Category> GetAsync(int id);

        Task<bool> DeleteAsync(int id);

        Task<int> InsertAsync(Entity.tede2.Category.Category note);

        Task<bool> UpdateAsync(Entity.tede2.Category.Category note);

        Task<bool> UpdateAsync(SqlKata.Query query);
        /// <summary>
        /// 获取所有
        /// </summary>
        /// <returns></returns>

        Task<IEnumerable<Entity.tede2.Category.Category>> GetAllAsync();
        /// <summary>
        /// 查询子集
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        Task<IEnumerable<Entity.tede2.Category.Category>> GetCategoryChildrenAsync(int parentId);

        Task<string> GetCategoryParentAsync(int id, string categoryName);
    }
}
