public static async Task <CropType> Load(WaDEContext db, CropTypeBuilderOptions opts) { var item = Create(opts); db.CropType.Add(item); await db.SaveChangesAsync(); return(item); }
public static CropType Create(CropTypeBuilderOptions opts) { return(new Faker <CropType>() .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())); }