示例#1
0
        public async Task <PageList <Member> > GetUserFriends(ParaMember para)
        {
            var list = _db.Member
                       .Where(x => !x.IsCloseData)
                       .OrderByDescending(x => x.LastDate)
                       .AsQueryable();

            return(await PageList <Member> .CreateAsync(list, para.PageNumber, para.PageSize));
        }
示例#2
0
        public async Task <PageList <Party> > GetMemberPartyList(ParaMember para)
        {
            var partylist = _db.Activity
                            .Include(x => x.Party)
                            .OrderByDescending(x => x.Party.PartyDate)
                            .Where(x => x.UserId == para.UserId)
                            .Select(x => x.Party);

            return(await PageList <Party> .CreateAsync(partylist, para.PageNumber, para.PageSize));
        }
示例#3
0
        public async Task <PageList <Member> > GetMatchList(ParaMember param)
        {
            var memberCondition = _db.MemberCondition.FirstOrDefault(x => x.UserId == param.UserId);

            if (memberCondition == null)
            {
                memberCondition = param.Condition;
            }

            var matchList = _db.Member
                            .Where(x => x.Sex != memberCondition.Sex)
                            .OrderByDescending(p => p.ActiveDate).AsQueryable();

            matchList = matchList.Where(x =>
                                        (x.Marry >= memberCondition.MarryMin && x.Marry <= memberCondition.MarryMax) &&
                                        (x.BirthYear >= memberCondition.YearMin && x.BirthYear <= memberCondition.YearMax) &&
                                        (x.Education >= memberCondition.EducationMin && x.Education <= memberCondition.EducationMax) &&
                                        (x.Heights >= memberCondition.HeightsMin && x.Heights <= memberCondition.HeightsMax) &&
                                        (x.Weights >= memberCondition.WeightsMin && x.Weights <= memberCondition.WeightsMax)
                                        );

            if (!string.IsNullOrEmpty(memberCondition.BloodInclude))
            {
                matchList = matchList.Where(x => memberCondition.BloodInclude.Contains(x.Blood));
            }

            if (!string.IsNullOrEmpty(memberCondition.StarInclude))
            {
                matchList = matchList.Where(x => memberCondition.StarInclude.Contains(x.Star));
            }

            if (!string.IsNullOrEmpty(memberCondition.CityInclude))
            {
                matchList = matchList.Where(x => memberCondition.CityInclude.Contains(x.City));
            }

            if (!string.IsNullOrEmpty(memberCondition.JobTypeInclude))
            {
                matchList = matchList.Where(x => memberCondition.JobTypeInclude.Contains(x.JobType));
            }

            if (!string.IsNullOrEmpty(memberCondition.ReligionInclude))
            {
                matchList = matchList.Where(x => memberCondition.ReligionInclude.Contains(x.Religion));
            }

            return(await PageList <Member> .CreateAsync(matchList, param.PageNumber, param.PageSize));
        }