public static async Task <CustomerType> Load(WaDEContext db, CustomerTypeBuilderOptions opts) { var item = Create(opts); db.CustomerType.Add(item); await db.SaveChangesAsync(); return(item); }
public static CustomerType Create(CustomerTypeBuilderOptions opts) { return(new Faker <CustomerType>() .RuleFor(a => a.Name, f => GenerateName()) .RuleFor(a => a.Term, f => f.Random.Word()) .RuleFor(a => a.Definition, f => f.Random.Words(5)) .RuleFor(a => a.State, f => f.Address.StateAbbr()) .RuleFor(a => a.SourceVocabularyUri, f => f.Internet.Url())); }