LootBoxGenerator/LootBoxSimulator/Program.cs
2024-12-10 11:29:26 +03:00

14 lines
421 B
C#

using LootBoxSimulator.Models.DAO;
RemoteDatabaseContext db = new RemoteDatabaseContext();
String path = Console.ReadLine();
StreamReader file = new StreamReader(path);
string line;
while ((line = file.ReadLine()) != null)
{
var row = line.Split(";");
CategoryDao categoryDao = new CategoryDao { Name = row[0]};
db.Categories.Add(categoryDao);
db.SaveChanges();
}
Console.WriteLine(file.ReadToEnd());