LootBoxGenerator/LootBoxSimulator/Program.cs

27 lines
599 B
C#
Raw Normal View History

2024-12-16 06:29:02 +00:00
using System.Reflection.Emit;
using System.Runtime.InteropServices.ComTypes;
using LootBoxSimulator.Models.DAO;
2024-12-05 11:29:52 +00:00
RemoteDatabaseContext db = new RemoteDatabaseContext();
2024-12-16 06:29:02 +00:00
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)
2024-12-05 11:29:52 +00:00
{
2024-12-16 06:29:02 +00:00
Console.WriteLine(categoryDao.Name);
}