2024-12-05 11:29:52 +00:00
|
|
|
|
using LootBoxSimulator.Models.DAO;
|
|
|
|
|
|
|
|
|
|
RemoteDatabaseContext db = new RemoteDatabaseContext();
|
2024-12-10 08:29:26 +00:00
|
|
|
|
String path = Console.ReadLine();
|
|
|
|
|
StreamReader file = new StreamReader(path);
|
|
|
|
|
string line;
|
|
|
|
|
while ((line = file.ReadLine()) != null)
|
2024-12-05 11:29:52 +00:00
|
|
|
|
{
|
2024-12-10 08:29:26 +00:00
|
|
|
|
var row = line.Split(";");
|
|
|
|
|
CategoryDao categoryDao = new CategoryDao { Name = row[0]};
|
|
|
|
|
db.Categories.Add(categoryDao);
|
|
|
|
|
db.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
Console.WriteLine(file.ReadToEnd());
|