Beispiel #1
0
        public async Task <TData <List <MqttThemeEntity> > > GetPageListJson([FromQuery] MqttThemeListParam param,
                                                                             [FromQuery] Pagination pagination)
        {
            var obj = await _mqttThemeBLL.GetPageList(param, pagination);

            return(obj);
        }
Beispiel #2
0
        /// <summary>
        ///     分页查询
        /// </summary>
        public async Task <List <MqttThemeEntity> > GetPageList(MqttThemeListParam param, Pagination pagination)
        {
            #region 查询条件

            var query = _mqttThemeEntityDB.AsQueryable();

            // 订阅主题名称
            if (!string.IsNullOrEmpty(param.ThemeName))
            {
                query = query.Where(p => p.ThemeName.Contains(param.ThemeName));
            }
            if (param.IsSubscribe.HasValue)
            {
                query = query.Where(p => p.IsSubscribe == param.IsSubscribe);
            }

            var data = await query.OrderByDescending(a => a.Id)
                       .ToPagedListAsync(pagination.PageIndex, pagination.PageSize);

            #endregion

            // 分页参数赋值
            pagination.TotalCount = data.TotalCount;
            return(data.Items.ToList());
        }
Beispiel #3
0
        public async Task <TData <List <MqttThemeEntity> > > GetList(MqttThemeListParam param)
        {
            var obj = new TData <List <MqttThemeEntity> >();

            obj.Data = await _mqttThemeService.GetList(param);

            obj.Tag = 1;
            return(obj);
        }
Beispiel #4
0
        public async Task <TData <List <MqttThemeEntity> > > GetPageList(MqttThemeListParam param, Pagination pagination)
        {
            var obj = new TData <List <MqttThemeEntity> >();

            obj.Data = await _mqttThemeService.GetPageList(param, pagination);

            obj.Total = pagination.TotalCount;
            obj.Tag   = 1;
            return(obj);
        }
Beispiel #5
0
        /// <summary>
        ///     带条件查询所有
        /// </summary>
        public async Task <List <MqttThemeEntity> > GetList(MqttThemeListParam param)
        {
            #region 查询条件

            var query = _mqttThemeEntityDB.AsQueryable();

            // 订阅主题名称
            if (!string.IsNullOrEmpty(param.ThemeName))
            {
                query = query.Where(p => p.ThemeName.Contains(param.ThemeName));
            }
            if (param.IsSubscribe.HasValue)
            {
                query = query.Where(p => p.IsSubscribe == param.IsSubscribe);
            }

            #endregion

            var data = await query.ToListAsync();

            return(data);
        }
Beispiel #6
0
        public async Task <TData <List <MqttThemeEntity> > > GetListJson([FromQuery] MqttThemeListParam param)
        {
            var obj = await _mqttThemeBLL.GetList(param);

            return(obj);
        }