Пример #1
0
        private bool MeetCriteria(Fund fund, SearchCriteria searchCriteria)
        {
            foreach (var filter in searchCriteria.Filters.Where(f=>f.Value.Any()))
            {
                var propertyInfo = _fundPropertyInfos.Single(f=>f.Name == filter.Key);
                if (!filter.Value.Contains(propertyInfo.GetValue(fund)?.ToString()))
                    return false;
            }

            return true;
        }
Пример #2
0
 public IList<Fund> GetFundsByCriteria(SearchCriteria searchCriteria)
 {
     return _funds.Where(f => MeetCriteria(f, searchCriteria)).ToList();
 }