I have a list of 9 items and I would like to generate exact 9 records in Standard table with the values in the list for StandardName column and use Bogus to generate the random value for the Description column. Is there a quick and easy way to do it with 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; }
}
}
You can use this Helper class: