Exemplo n.º 1
0
        public IEncoderDescriptor <TElement> HasElements <TElement>(Func <TEntity, IEnumerable <TElement> > getter)
        {
            var elementDefinition = this.definition.Create <TElement>();
            var elementDescriptor =
                new TreeEncoderDescriptor <TState, TNative, TElement>(this.converter, elementDefinition);

            return(TreeEncoderDescriptor <TState, TNative, TEntity> .BindArray(this.definition, getter, elementDescriptor));
        }
Exemplo n.º 2
0
        public IEncoderDescriptor <TElement> HasElements <TElement>(Func <TEntity, IEnumerable <TElement> > getter,
                                                                    IEncoderDescriptor <TElement> descriptor)
        {
            if (!(descriptor is TreeEncoderDescriptor <TState, TNative, TElement> ancestor))
            {
                throw new ArgumentOutOfRangeException(nameof(descriptor), "incompatible descriptor type");
            }

            return(TreeEncoderDescriptor <TState, TNative, TEntity> .BindArray(this.definition, getter, ancestor));
        }