Exemplo n.º 1
0
        /// <summary>
        /// 获取资源过滤条件
        /// </summary>
        /// <param name="resourceId"></param>
        /// <returns></returns>
        private async Task <List <ConditionalModel> > GetResourceFilter(string resourceId)
        {
            var conModels = new List <ConditionalModel>();

            var data = await _dbContext.Db.Queryable <ResourceFilterEntity>().Where(m => m.ResourceId == resourceId && m.IsDel == false).ToListAsync();

            foreach (var item in data)
            {
                conModels.Add(new ConditionalModel()
                {
                    FieldName       = item.FieldName,
                    ConditionalType = item.ConditionalType,
                    FieldValue      = _loginInfo.GetType().GetProperty(item.FieldName).GetValue(_loginInfo).ToString()
                });
            }

            return(conModels);
        }