bchavez / Bogus

:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Other
8.79k stars 499 forks source link

What is the Ignore function do? #391

Closed HillCat closed 3 years ago

HillCat commented 3 years ago

Version Information

Software Version(s)
Bogus NuGet Package 33.1.1
.NET Core? .net core 5.0
.NET Full Framework? no
Windows OS? windows 10 pro 21H1
Linux OS? no
Visual Studio? visual studio 2019 16.11.2

What locale are you using with Bogus?

What's the problem?

I want to let Bogus don't generator some properties, I use the 'Ignore' function, but the property Id is generated at all because my SQL database primary key Id is auto-generated, the id can't be given by mock data. I don't need the Id. TnWHvaXnN2

What possible solutions have you considered?

I have no idea.

Do you have sample code to show what you're trying to do?

no

salixzs commented 3 years ago

If your property is not nullable - it will have default value, which is 0 (zero) for integer/long.