LootBoxGenerator/LootBoxSimulator/Program.cs
2024-12-16 09:29:02 +03:00

27 lines
599 B
C#

using System.Reflection.Emit;
using System.Runtime.InteropServices.ComTypes;
using LootBoxSimulator.Models.DAO;
RemoteDatabaseContext db = new RemoteDatabaseContext();
CategoryDao newCategory = new CategoryDao
{
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);
}