add samples
This commit is contained in:
parent
13f06cb083
commit
81042a87fc
@ -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();
|
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(";");
|
Name = "epic"
|
||||||
CategoryDao categoryDao = new CategoryDao { Name = row[0]};
|
};
|
||||||
db.Categories.Add(categoryDao);
|
//change value
|
||||||
db.SaveChanges();
|
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());
|
|
@ -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+684a1ad6929b649ac97d03976112fc7cfccb5497")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+13f06cb083c5b4aeca07e78be088bd7df3d7e65d")]
|
||||||
[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")]
|
||||||
|
Loading…
Reference in New Issue
Block a user