public static TypeReader GetReader(Type type) { Type baseType = Enum.GetUnderlyingType(type); var constructor = typeof(EnumTypeReader <>).MakeGenericType(baseType).GetTypeInfo().DeclaredConstructors.First(); return((TypeReader)constructor.Invoke(new object[] { type, PrimitiveParsers.Get(baseType) })); }
public SimpleTypeReader() { _tryParse = PrimitiveParsers.Get <T>(); }