i want to seed the db from a text file where on each row i have a word(aprox 70000) ex: word1(next line) word2(next line) word3(next line)
i'm guessing i have to use the seed method like i add something else for example
protected override void Seed(BabyStore.DAL.StoreContext context)
{
var categories = new List<Category>
{
new Category { Name = "Clothes" },
new Category { Name = "Play and Toys" },
new Category { Name = "Feeding" },
new Category { Name = "Medicine" },
new Category { Name= "Travel" },
new Category { Name= "Sleeping" }
};
categories.ForEach(c => context.Categories.AddOrUpdate(p => p.Name, c));
context.SaveChanges();
the table would be something like words. so i would have i guess a table with 70000 words. so i need to read the file and upload those words to be a name for each entry in db?(this is my own thinking but i do't kniow how to do it)
my question is how can i use a text file to seed here? or do i have to do it in another way?(code first) Thank you