I would like to use AutoBogus to automatically generate an object, but I only have the Type information and cannot apply the generic constraint.
Would it be possible to provide an overload like
public static object Generate(Type type, Action<IAutoGenerateConfigBuilder> configure = null);
which will generate an object of type type?
Background:
I tried to implement something like the AutoDataAttribute but using AutoBogus to generate the objects. But I only get a ParameterInfo and would need to create an object from the weakly-typed ParameterType information.
I couldn't find any example neither here nor in Bogus directly. Is this simply not possible?
I would like to use AutoBogus to automatically generate an object, but I only have the
Type
information and cannot apply the generic constraint.Would it be possible to provide an overload like
which will generate an object of type
type
?Background: I tried to implement something like the AutoDataAttribute but using AutoBogus to generate the objects. But I only get a
ParameterInfo
and would need to create an object from the weakly-typedParameterType
information.I couldn't find any example neither here nor in Bogus directly. Is this simply not possible?