Closed pauldbentley closed 2 years ago
Hey @pauldbentley
Apologies for the delayed response. Using an override is certainly a way of achieving what you need. Making the ParentType
public is definitely something we can do and I see benefits it would add.
I will make the change and publish a new version.
Nick.
Hey @pauldbentley
I just realized I neglected to tell you a new version was released with the ParentType
made public.
Nick.
I have an entity I would like to fake, which has a constructor parameter "code" - I need this to be 3 characters in length, the constructor provides validation for this, so any string not 3 charaters will throw an exception.
I was trying to use an
AutoGeneratorOverride
and checking if theGenerateName
is"code"
- but I only want to do this if the ParentType is the type I'm interested in. I note that theParentType
property is internal.So anytime I do
new AutoFaker<MyObject>().Generate()
- the code parameter is 3 characters.Am I going about this the wrong way?