add samples

This commit is contained in:
KP9lKk 2024-12-16 09:29:02 +03:00
parent 13f06cb083
commit 81042a87fc
2 changed files with 25 additions and 12 deletions

View File

@ -1,14 +1,27 @@
using LootBoxSimulator.Models.DAO;
using System.Reflection.Emit;
using System.Runtime.InteropServices.ComTypes;
using LootBoxSimulator.Models.DAO;
RemoteDatabaseContext db = new RemoteDatabaseContext();
String path = Console.ReadLine();
StreamReader file = new StreamReader(path);
string line;
while ((line = file.ReadLine()) != null)
CategoryDao newCategory = new CategoryDao
{
var row = line.Split(";");
CategoryDao categoryDao = new CategoryDao { Name = row[0]};
db.Categories.Add(categoryDao);
db.SaveChanges();
Name = "epic"
};
//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();
//display value
await foreach (var categoryDao in db.Categories)
{
Console.WriteLine(categoryDao.Name);
}
Console.WriteLine(file.ReadToEnd());

View File

@ -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+684a1ad6929b649ac97d03976112fc7cfccb5497")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+13f06cb083c5b4aeca07e78be088bd7df3d7e65d")]
[assembly: System.Reflection.AssemblyProductAttribute("LootBoxSimulator")]
[assembly: System.Reflection.AssemblyTitleAttribute("LootBoxSimulator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]