Пример #1
0
        public FilteringCursor(CaseCursor originalCursor, FilterTransformer transformer)
        {
            if (transformer == null)
            {
                throw new ArgumentNullException(nameof(transformer));
            }

            cursor = originalCursor ?? throw new ArgumentNullException(nameof(originalCursor));
            filter = transformer.GetFilter() ?? throw new ArgumentNullException(nameof(filter));
        }
Пример #2
0
        public static ICaseFrame FilterCases(this ICaseFrame caseFrame, IEnumerable <string> caseIds)
        {
            if (caseFrame == null)
            {
                throw new ArgumentNullException(nameof(caseFrame));
            }
            if (caseIds == null)
            {
                throw new ArgumentNullException(nameof(caseIds));
            }

            var ids = new HashSet <string>(caseIds);

            var filterTransformer = new FilterTransformer(c => ids.Contains(c.GetId()));

            filterTransformer.Prepare(caseFrame);

            return(filterTransformer.Transform(caseFrame));
        }
Пример #3
0
 public FilteringCaseFrame(ICaseFrame frame, FilterTransformer transformer) : base(frame)
 {
     this.transformer = transformer ?? throw new ArgumentNullException(nameof(transformer));
 }