add import
This commit is contained in:
parent
9c61ffba70
commit
1889ede866
@ -1,29 +1,28 @@
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Threading.Channels;
|
||||
using LootBoxSimulator.Models.DAO;
|
||||
|
||||
RemoteDatabaseContext db = new RemoteDatabaseContext();
|
||||
|
||||
|
||||
//add value
|
||||
CategoryDao newCategory = new CategoryDao
|
||||
Console.WriteLine("Enter path to file");
|
||||
string? path = Console.ReadLine();
|
||||
if (path == null) return;
|
||||
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"
|
||||
};
|
||||
db.Categories.Add(newCategory);
|
||||
db.SaveChanges();
|
||||
//change value
|
||||
var categoriesUpd = db.Categories.Find(3);
|
||||
if(categoriesUpd == null) return;
|
||||
categoriesUpd.Name = "rare";
|
||||
//remove value
|
||||
var categories = db.Categories.Find(3);
|
||||
if(categories == null) return;
|
||||
db.Remove(categories);
|
||||
db.SaveChanges();
|
||||
var line = row.Split(',');
|
||||
if(!decimal.TryParse(line[2], out var decimalValue)) continue;
|
||||
RateDao dao = new RateDao
|
||||
{
|
||||
Name = line[0],
|
||||
Color = line[1],
|
||||
Rate = decimalValue
|
||||
|
||||
//display value
|
||||
await foreach (var categoryDao in db.Categories)
|
||||
{
|
||||
Console.WriteLine(categoryDao.Name);
|
||||
}
|
||||
};
|
||||
db.Rates.Add(dao);
|
||||
}
|
||||
db.SaveChanges();
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("LootBoxSimulator")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[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.AssemblyTitleAttribute("LootBoxSimulator")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user