using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service
{
    internal class BaseExtend
    {
        //public List<ExpandoObject> GetList(string tablename, string fields, string domain, string orderby)
        //{
        //    int totalCount = 0;
        //    return GetList(tablename, fields, domain, orderby, 0, 0, ref totalCount);
        //}
        //public List<ExpandoObject> GetList(string tablename, string fields, string domain, string orderby, int pageNum, int pageSize, ref int totalCount)
        //{
        //    var sql = base.Context.Queryable(tablename, tablename);
        //    if (!string.IsNullOrWhiteSpace(domain))
        //        sql = sql.Where(base.Context.Utilities.JsonToConditionalModels(domain));
        //    if (!string.IsNullOrWhiteSpace(fields) && fields!="*")
        //        sql = sql.Select(fields);
        //    if (!string.IsNullOrWhiteSpace(orderby))
        //        sql = sql.OrderBy(orderby);
        //    else
        //        sql = sql.OrderBy("id desc");

        //    if (pageNum == 0 && pageSize == 0)
        //        return sql.ToList();
        //    else
        //        return sql.ToPageList(pageNum, pageSize, ref totalCount);
        //}
    }
}
