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; }
public bool Equals(OneOf <T0> other) { if (_index != other._index) { return(false); } switch (_index) { case 0: return(Equals(_value0, other._value0)); default: return(false); } }