コード例 #1
0
        private static bool ShouldLike(UserExtended user, AgeRange ageRange, List <CityExtended> cities)
        {
            if (!user.IsAgeBetween(ageRange.Min, ageRange.Max))
            {
                return(false);
            }

            if (user.HasBeenOfflineMoreThanDays(2))
            {
                return(false);
            }

            //  var cityIds = cities.Select(x => x.Id.Value).Distinct().ToArray();
            if (!user.FromCity(cities))
            {
                return(false);
            }
            if (user.Sex != Sex.Female)
            {
                return(false);
            }

            if (user.BlackListed())
            {
                return(false);
            }

            if (user.IsFriend.HasValue && user.IsFriend == true)
            {
                return(false);
            }

            if (!user.IsSingle())
            {
                return(false);
            }

            if (string.IsNullOrWhiteSpace(user.PhotoId))
            {
                return(false);
            }

            return(user.CommonCount == 0 || !user.CommonCount.HasValue);
        }