コード例 #1
0
            public IAllowedMemberValues Get()
            {
                var primary = _specifications.Concat(_instances).GroupBy(x => x.Key).ToDictionary(x => x.Key, Create);
                var result  = new MappedAllowedMemberValues(new Dictionary(primary));

                return(result);
            }
コード例 #2
0
        IAllowedMemberValues Register(IServiceProvider arg)
        {
            IParameterizedSource <MemberInfo, IAllowedValueSpecification>
            seed         = new MappedAllowedMemberValues(Specifications),
                fallback = new FixedInstanceSource <MemberInfo, IAllowedValueSpecification>(_allowed);
            var source   = this.Appending(fallback).Aggregate(seed, (current, item) => current.Or(item));
            var result   = new AllowedMemberValues(source);

            return(result);
        }
        IAllowedMemberValues Register(IServiceProvider arg)
        {
            IParameterizedSource <MemberInfo, IAllowedValueSpecification>
            seed = new MappedAllowedMemberValues(Specifications.ToDictionary(x => x.Key, x => (ISpecification <object>)x.Value)
                                                 .Concat(Instances)
                                                 .GroupBy(x => x.Key)
                                                 .ToDictionary(x => x.Key, Create)),
                fallback = new FixedInstanceSource <MemberInfo, IAllowedValueSpecification>(_allowed);
            var source   = this.Appending(fallback)
                           .Aggregate(seed, (current, item) => current.Or(item));
            var result = new AllowedMemberValues(source);

            return(result);
        }