using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Com.FirmLib.Entity
{
    /// <summary>
    /// 查询基础模块
    /// </summary>
    public class BaseSearch
    {
        [JsonIgnore]
        public JObject AttachObject { get; set; }
        /// <summary>
        /// 获取object对象
        /// </summary>
        /// <returns></returns>
        public virtual JObject ToJObject()
        {
            var jo= JObject.FromObject(this);
            if (AttachObject != null)
            {
                jo.Merge(AttachObject);
            }
            return jo;
        }
    }
    /// <summary>
    /// 分页数据
    /// </summary>
    public class SearchLimit:BaseSearch
    {
        /// <summary>
        /// 跳过的数量
        /// </summary>
        [JsonProperty("skip")]
        public int SkipCount { get; set; }
        /// <summary>
        /// 获取的数量
        /// </summary>
        [JsonProperty("count")]
        public int GetCount { get; set; }

       
    }
    /// <summary>
    /// 过滤条件
    /// </summary>
    public class SearchFilter : BaseSearch
    {
       
    }
    /// <summary>
    /// 限定条件
    /// </summary>
    public class SearchCriteria : BaseSearch
    {
       
    }
}
