﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Cartinla.TaonyNet.Cms.Entity;
using Webdiyer.WebControls.Mvc;

namespace Cartinla.TaonyNet.Cms.Services
{
   /// <summary>
   /// 存档服务接口
   /// </summary>
    public interface ITopicService
    {
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns>实体</returns>
        TopicInfo GetEntity(int id);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns>是否添加成功</returns>
        bool Add(TopicInfo model);

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns>是否更新成功</returns>
        bool Update(TopicInfo model);

        /// <summary>
        /// 添加或者更新
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns>是否保存成功</returns>
        bool AddOrUpdate(TopicInfo model);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns>是否删除成功</returns>
        bool Delete(int id);



        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <returns>列表集合</returns>
        List<TopicInfo> GetList(Expression<Func<TopicInfo, bool>> where);

        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="pageSize">分页大小</param>
        /// <param name="pageIndex">分页索引</param>
        /// <param name="where">查询条件</param>
        /// <returns>分页列表集合</returns>
        PagedList<TopicInfo> GetPageList(int pageSize, int pageIndex, Expression<Func<TopicInfo, bool>> where);
    }
}
