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.62k stars 491 forks source link

Why do you want to restrict that a generic type must be a class? #435

Open VAllens opened 2 years ago

VAllens commented 2 years ago

Version Information

Software Version(s)
Bogus NuGet Package 34.0.2
.NET Core? .NET 6.0.400
.NET Full Framework?
Windows OS? Windows 10 Pro
Linux OS?
Visual Studio? Visual Studio 2022 Community

What locale are you using with Bogus?

en-US

What's the problem?

Faker<T> : IFakerTInternal, ILocaleAware, IRuleSet<T> where T : class

Why do you want to restrict that a generic type must be a class? In some cases, I use struct...

What possible solutions have you considered?

I have considered using non generic Faker. Examples: Using the Faker facade Using DataSets directly

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

(Please be complete. Provide all code necessary to run your example in LINQPad.) (The more complete code examples are, the more accurate answers will be.) (https://www.linqpad.net)