add import

This commit is contained in:
KP9lKk 2024-12-16 14:24:55 +03:00
parent 9c61ffba70
commit 1889ede866
2 changed files with 22 additions and 23 deletions

View File

@ -1,29 +1,28 @@
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Runtime.InteropServices.ComTypes; using System.Runtime.InteropServices.ComTypes;
using System.Threading.Channels;
using LootBoxSimulator.Models.DAO; using LootBoxSimulator.Models.DAO;
RemoteDatabaseContext db = new RemoteDatabaseContext(); RemoteDatabaseContext db = new RemoteDatabaseContext();
Console.WriteLine("Enter path to file");
string? path = Console.ReadLine();
//add value if (path == null) return;
CategoryDao newCategory = new CategoryDao if (!bool.TryParse(Console.ReadLine(), out bool HaveHeader)) return;
StreamReader file = new StreamReader(path);
string row = String.Empty;
if(HaveHeader) row = file.ReadLine();
Console.WriteLine(row);
while ((row = file.ReadLine()) != null)
{ {
Name = "epic" var line = row.Split(',');
}; if(!decimal.TryParse(line[2], out var decimalValue)) continue;
db.Categories.Add(newCategory); RateDao dao = new RateDao
db.SaveChanges(); {
//change value Name = line[0],
var categoriesUpd = db.Categories.Find(3); Color = line[1],
if(categoriesUpd == null) return; Rate = decimalValue
categoriesUpd.Name = "rare";
//remove value
var categories = db.Categories.Find(3);
if(categories == null) return;
db.Remove(categories);
db.SaveChanges();
//display value };
await foreach (var categoryDao in db.Categories) db.Rates.Add(dao);
{ }
Console.WriteLine(categoryDao.Name); db.SaveChanges();
}

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("LootBoxSimulator")] [assembly: System.Reflection.AssemblyCompanyAttribute("LootBoxSimulator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+13f06cb083c5b4aeca07e78be088bd7df3d7e65d")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9c61ffba70b4d7b6c85c3d3d7b357920470df9fc")]
[assembly: System.Reflection.AssemblyProductAttribute("LootBoxSimulator")] [assembly: System.Reflection.AssemblyProductAttribute("LootBoxSimulator")]
[assembly: System.Reflection.AssemblyTitleAttribute("LootBoxSimulator")] [assembly: System.Reflection.AssemblyTitleAttribute("LootBoxSimulator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]