예제 #1
0
        public async Task <List <string> > GetLandmarkStreetsAsync(string lpcNumber)
        {
            Guard.ThrowIfNullOrWhitespace(lpcNumber, "LPC Number");

            var predicate = PredicateBuilder.True <Landmark>();

            predicate = predicate.And(x => x.LP_NUMBER == lpcNumber);

            var results = await _landmarkRepository.FindByAsync(predicate);

            var items = results.Select(x => x.PLUTO_ADDR)
                        .Select(x => new
            {
                x = !string.IsNullOrWhiteSpace(x) && x.Any(char.IsDigit)
                        ? Regex.Replace(x, @"^[\d-]*\s*", "", RegexOptions.Multiline)
                        : x,
            }).Distinct().ToList();

            var list = new List <string>();

            foreach (var i in items)
            {
                list.Add(i.x);
            }

            return(list.OrderBy(x => x).ToList());
        }