Hi @antabuze!
\nYou should call the base
constructor.
\nUsing your example:
public sealed class CompanyFaker : Faker<Company>\n{\n private CompanyFaker() : base(\"sv\") \n {\n RuleFor(c => c.Id, f => f.Random.Guid());\n RuleFor(c => c.Name, f => f.Company.CompanyName());\n }\n}
-
How do u set the locale while using the inheritance approach? I tried setting the Locale property in my constructor, but it still seems to default back to english. Example:
|
Beta Was this translation helpful? Give feedback.
-
Hi @antabuze! You should call the public sealed class CompanyFaker : Faker<Company>
{
private CompanyFaker() : base("sv")
{
RuleFor(c => c.Id, f => f.Random.Guid());
RuleFor(c => c.Name, f => f.Company.CompanyName());
}
} |
Beta Was this translation helpful? Give feedback.
Hi @antabuze!
You should call the
base
constructor.Using your example: