Closed WbryantCampbell closed 1 year ago
You might want to double check that all of the fields that you're setting to null with a non-zero probability are nullable. For instance:
.RuleFor(m => m.Country, f => f.Random.Int(0, 1000).OrNull(f, .75f))
Make sure that the Country field is nullable. Along with any other rules you're using OrNull
on.
Hi @WbryantCampbell, thank you for the bug report and source code. Unfortunately, I can't compile the example you provided. You'll need to send us a complete example that runs and compiles in LinqPad that demonstrates the problem if you want more help: https://www.linqpad.net
Feel free to re-open the GH issue if you can provide more information.
Thanks, Brian
Version Information
What locale are you using with Bogus?
en-us
What is the expected behavior?
I would love to see my static class finish initialization.
What is the actual behavior?
The process runs all the way MixtureFaker.Generate() whe
Please provide a stack trace.
at Bogus.Extensions.ExtensionsForPropertyInfo.<>c__DisplayClass2_0
2.1.PopulateProperty(T instance, PopulateAction
1 action) at Bogus.Faker1.PopulateInternal(T instance, String[] ruleSets) at Bogus.Faker
1.Generate(String ruleSets) at Verisk3E.Notify.Entity.SeededData.NotifyFakeData.<>cDisplayClass80_0.Any possible solutions?
I could maybe switch to faker facade? I would really like not to redo all of my work up to this point though.
How do you reproduce the issue?
Running this code in my file.
Do you have a unit test that can demonstrate the bug?
No just the static file failing to create my seed data.
Can you identify the location in Bogus' source code where the problem exists?
No
If the bug is confirmed, would you be willing to submit a PR?
Yes or No?
If there's anything I can do to help, I 'd be glad to help.
NotifyFakeData.txt