Exemplo n.º 1
0
        /// <summary>
        /// Creates <see langword="default"/> case
        /// </summary>
        /// <param name="builder"></param>
        /// <typeparam name="TR"></typeparam>
        /// <returns></returns>
        public SwitchBuilder <T, TR> Default <TR>(Action <ExpressionContainer <T>, BlockBuilder> builder)
        {
            var switchBuilder = new SwitchBuilder <T, TR>(Value)
            {
                Cases          = Cases,
                ComparerMethod = ComparerMethod,
                DefaultCase    = DefaultCase
            };

            return(switchBuilder.Default(builder));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates <see langword="default"/> case
        /// </summary>
        /// <param name="expression"></param>
        /// <typeparam name="TR"></typeparam>
        /// <returns></returns>
        public SwitchBuilder <T, TR> Default <TR>(ExpressionContainer <TR> expression)
        {
            var switchBuilder = new SwitchBuilder <T, TR>(Value)
            {
                Cases          = Cases,
                ComparerMethod = ComparerMethod,
                DefaultCase    = DefaultCase
            };

            return(switchBuilder.Default(expression));
        }