Exemplo n.º 1
0
        public static ContravariantPolicy Create(
            Action <ContravariantPolicyBuilder> build)
        {
            if (build == null)
            {
                throw new ArgumentNullException(nameof(build));
            }
            var policy  = new ContravariantPolicy();
            var builder = new ContravariantPolicyBuilder(policy);

            build(builder);
            return(policy);
        }
Exemplo n.º 2
0
        public static ContravariantPolicy <Cb> Create <Cb>(
            Func <Cb, object> target,
            Action <ContravariantPolicyBuilder <Cb> > build)
        {
            if (build == null)
            {
                throw new ArgumentNullException(nameof(build));
            }
            var policy  = new ContravariantPolicy <Cb>(target);
            var builder = new ContravariantPolicyBuilder <Cb>(policy);

            build(builder);
            return(policy);
        }