Beispiel #1
0
        private void AddMappingOneOf <TFrom, TTo>(OneOf <MapFunc <TFrom, TTo>,
                                                         MapFuncWithMapper <TFrom, TTo> > func)
        {
            Type to   = typeof(TTo);
            Type from = typeof(TFrom);

            if (!mappersFromTo.ContainsKey(from))
            {
                mappersFromTo[from] = new Dictionary <Type, object>();
            }
            Dictionary <Type, object> mappersTo = mappersFromTo[from];

            mappersTo[to] = func;
        }
Beispiel #2
0
        public bool Equals(OneOf <T0> other)
        {
            if (_index != other._index)
            {
                return(false);
            }
            switch (_index)
            {
            case 0:
                return(Equals(_value0, other._value0));

            default:
                return(false);
            }
        }