我有一个包含 9 个项目的列表,我想在Standard表中使用StandardName列的列表中的值生成准确的 9 条记录,并使用 Bogus 为Description列生成随机值。使用Bogus C#是否有一种快速简便的方法?
var standardNames = new List<string>()
{
"English Language Arts Standards",
"Mathematics Standards",
"Fine Arts Standards",
"Language Arts Standards",
"Mathematics Standards",
"Physical Education and Health Standards",
"Science Standards",
"Social Sciences Standards",
"Technology Standards"
};
using System.Collections.Generic;
namespace EFCore_CodeFirst.Model.School
{
public class Standard
{
public Standard()
{
this.Students = new HashSet<Student>();
this.Teachers = new HashSet<Teacher>();
}
public int StandardId { get; set; }
public string StandardName { get; set; }
public string Description { get; set; }
public virtual ICollection<Student> Students { get; set; }
public virtual ICollection<Teacher> Teachers { get; set; }
}
}