Пример #1
0
                /// <summary>
                /// Add some columns from <paramref name="annotations"/> into our new annotations, by applying <paramref name="selector"/>
                /// to all the names.
                /// </summary>
                /// <param name="annotations">The annotations row to take values from.</param>
                /// <param name="selector">The predicate describing which annotation columns to keep.</param>
                public void Add(Annotations annotations, Func <string, bool> selector)
                {
                    if (annotations == null)
                    {
                        return;
                    }

                    if (selector == null)
                    {
                        throw new ArgumentNullException(nameof(selector));
                    }

                    foreach (var column in annotations.Schema)
                    {
                        if (selector(column.Name))
                        {
                            _items.Add((column.Name, column.Type, annotations.GetGetterInternal(column.Index), column.Annotations));
                        }
                    }
                }