예제 #1
0
        public static async Task <Variable> Load(WaDEContext db, VariableBuilderOptions opts)
        {
            var item = Create(opts);

            db.Variable.Add(item);
            await db.SaveChangesAsync();

            return(item);
        }
예제 #2
0
 public static Variable Create(VariableBuilderOptions opts)
 {
     return(new Faker <Variable>()
            .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()));
 }