Skip to content

Setting locale using Faker<T> inheritance. #446

Answered by ChristoWolf
manscronholm asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @antabuze!

You should call the base constructor.
Using your example:

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());
    }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@manscronholm
Comment options

Answer selected by bchavez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants