Example #1
0
        public Paginated <ProfileResponseDto> Search(string uid, IEnumerable <int> skills, LocationRadius locationRadius, int page, int pageSize)
        {
            IEnumerable <int> skillsParam         = null;
            string            uidParam            = null;
            LocationRadius    locationRadiusParam = null;

            if (skills != null && skills.Count() > 0)
            {
                skillsParam = skills;
            }

            if (!string.IsNullOrEmpty(uid))
            {
                uidParam = uid;
            }

            if (locationRadius != null && locationRadius.Radius > 0)
            {
                locationRadius.Validate();
                locationRadiusParam = new LocationRadius()
                {
                    Radius    = locationRadius.Radius * 1000,
                    Longitude = locationRadius.Longitude,
                    Latitude  = locationRadius.Latitude
                };
            }

            return(_profilesRepository.Search(uidParam, skillsParam, locationRadiusParam, page, pageSize).To <ProfileResponseDto> (_profileMapper.map));
        }