Example #1
0
        /// <summary>
        /// 根据条件查询计划,返回查询的实体列表
        /// </summary>
        /// <param name="mSearchMember">员工查询类对象</param>
        /// <returns></returns>
        public async Task <IEnumerable <MemberRelationsEntity> > GetEntitiesAsync(MemberRelationsSearch SearchCondition)
        {
            IQueryable <MemberRelationsEntity> Items = _GhDbContext.dsMemberRelations.AsNoTracking() as IQueryable <MemberRelationsEntity>;

            if (SearchCondition != null && !string.IsNullOrWhiteSpace(SearchCondition.UserId))
            {
                if (!string.IsNullOrWhiteSpace(SearchCondition.Id))
                {
                    Items = Items.Where(e => e.Id.Equals(SearchCondition.Id, StringComparison.Ordinal));//对两个字符串进行byte级别的比较,性能好、速度快。
                }
                if (!string.IsNullOrWhiteSpace(SearchCondition.MemberId))
                {
                    Items = Items.Where(e => e.MemberId.Equals(SearchCondition.MemberId, StringComparison.Ordinal));//对两个字符串进行byte级别的比较,性能好、速度快。
                }
                if (!string.IsNullOrWhiteSpace(SearchCondition.Remark))
                {
                    Items = Items.Where(e => e.Remark.Contains(SearchCondition.Remark, StringComparison.Ordinal));//对两个字符串进行byte级别的比较,性能好、速度快。
                }
                return(await Items.ToListAsync().ConfigureAwait(false));
            }
            return(new List <MemberRelationsEntity>());
        }
 public CurUcViewModel()
 {
     CurRecords      = new ObservableCollection <MemberRelations>();
     SearchCondition = new MemberRelationsSearch();
 }
 public async Task <IEnumerable <MemberRelationsEntity> > GetAsync([FromQuery] MemberRelationsSearch SearchCondition)
 {
     return(await _DataRepository.GetEntitiesAsync(SearchCondition).ConfigureAwait(false));
 }