Пример #1
0
        public virtual TViewModel Get(Expression <Func <TViewModel, bool> > whereSelector, string include = "", OrderByEntity orderBy = null)
        {
            var item = DAL.Get(MySQLUtility.GetModelExpr <TViewModel, TModel>(whereSelector), include, orderBy);

            if (item != null)
            {
                return(item.MapTo(RetrieveSelector));
            }
            else
            {
                return(default);
Пример #2
0
        public TModel Get(Expression <Func <TModel, TForeignModel, bool> > whereSelector, string include = "", OrderByEntity orderBy = null)
        {
            var arr = MySQLUtility.ExecuteParm(whereSelector, include);

            return(GetList(whereSelector, include, orderBy).FirstOrDefault());
        }
Пример #3
0
        public IEnumerable <TModel> GetList(Expression <Func <TModel, TForeignModel, bool> > whereSelector, int pageSize = 20, int pageNum = 1, string include = "", OrderByEntity orderBy = null)
        {
            var arr = MySQLUtility.ExecuteParm(whereSelector, include);

            return(Fabricate.GetListByTable <TModel>(CommandType.Text, CreateSql(SqlType.GetPage_MySQL, arr.Item4, arr.Item1.Remove(arr.Item1.Length - 1), arr.Item2, orderBy, pageSize, pageNum), arr.Item5, include, arr.Item3.ToArray()));
        }
Пример #4
0
 public Task <List <TViewModel> > GetListAsync(WhereQueryable <TViewModel, TForeignModel> whereSelector, int pageSize, int pageNum, string include = "", OrderByEntity orderBy = null)
 {
     return(Task.Run(() => GetList(whereSelector.Expr, pageSize, pageNum, include, orderBy)));
 }
Пример #5
0
 public List <TViewModel> GetList(WhereQueryable <TViewModel, TForeignModel> whereSelector, string include = "", OrderByEntity orderBy = null)
 {
     return(GetList(whereSelector.Expr, include, orderBy));
 }
Пример #6
0
 public Task <TViewModel> GetAsync(WhereQueryable <TViewModel, TForeignModel> whereSelector, string include = "", OrderByEntity orderBy = null)
 {
     return(Task.Run(() => Get(whereSelector.Expr, include, orderBy)));
 }
Пример #7
0
 public virtual Task <List <TViewModel> > GetListAsync(Expression <Func <TViewModel, TForeignModel, bool> > whereSelector, int pageSize, int pageNum, string include = "", OrderByEntity orderBy = null)
 {
     return(Task.Run(() => GetList(whereSelector, pageSize, pageNum, include, orderBy)));
 }
Пример #8
0
 public virtual List <TViewModel> GetList(Expression <Func <TViewModel, TForeignModel, bool> > whereSelector, int pageSize, int pageNum, string include = "", OrderByEntity orderBy = null)
 {
     return(DAL.GetList(MySQLUtility.GetModelExpr <TViewModel, TModel, TForeignModel>(whereSelector), pageSize, pageNum, include, orderBy).MapAllTo(RetrieveSelector).ToList());
 }