public Gladiatormanager(EditorContext db) { DB = db; }
static void Main(string[] args) { using (var db = new EditorContext()) { Console.WriteLine("Temp Switch Meny"); Console.WriteLine("1: User. 2: Lanistas. 3: Gladiator. 4: Items. 5: BattleResult. 6: GladiatorKills. "); var c = Console.ReadKey(); switch (c.Key) { case ConsoleKey.D1: Console.WriteLine("\nUser: "******"1: Create. 2: Read. 3: Update. 4: Destroy. 5: Cancel"); var crud = Console.ReadKey(); Usermanager usermanager = new Usermanager(db); Lanistamanager lanistamanager = new Lanistamanager(db); Gladiatormanager gladiatormanager = new Gladiatormanager(db); //string username1 = "Timon",Pasword = "hakuna",email = "matata@bajs"; //List<User> test; //usermanager.Create(username1,Pasword,email); //test = usermanager.ReadAllUser(); /*foreach (var item in test) * { * Console.WriteLine("user:{0} Pas:{1} em:{2} id:{3}", item.UserName,item.Password, * item.Email,item.UserId); * }*/ //User test2 = test.OrderBy(s => s.UserName).First<User>(); //Console.WriteLine("user:{0}", test2.UserName); //lanistamanager.Create("Mouse", test2.UserId); //var test3 = lanistamanager.ReadAll(test2.UserId); /*foreach (var item in test3) * { * Console.WriteLine("Lani:{0} User:{1} mony:{2} id:{3}", item.LanistaName,item.User.UserName, * item.Money,item.LanistaId); * }*/ //var test4 = test3.OrderBy(s => s.LanistaName).First<Lanista>(); //lanistamanager.Update(test4, "Jesus", 0); //gladiatormanager.LanistaCreate(test4); //var test5 = gladiatormanager.LanistaReadAll(test4); /*foreach (var item in test5) * { * Console.WriteLine("Lani:{0} User:{1} GladID:{2} Morale:{3}", item.Lanista.LanistaName, * item.Lanista.User.UserName, * item.GladiatorId, item.Morale); * }*/ //gladiatormanager.Update() //usermanager.Update(test2, username1, Pasword,email,false); //usermanager.Destroy(); break; case ConsoleKey.D2: Console.WriteLine("Lanistas: "); Console.WriteLine("1: Create. 2: Read. 3: Update. 4: Destroy."); break; case ConsoleKey.D3: Console.WriteLine("Gladiator: "); Console.WriteLine("1: Create. 2: Read. 3: Update. 4: Destroy."); break; case ConsoleKey.D4: Console.WriteLine("Items: "); Console.WriteLine("1: Create. 2: Read. 3: Update. 4: Destroy."); break; case ConsoleKey.D5: Console.WriteLine("BattleResult: "); Console.WriteLine("1: Create. 2: Read. 3: Update. 4: Destroy."); break; case ConsoleKey.D6: Console.WriteLine("GladiatorKills: "); Console.WriteLine("1: Create. 2: Read. 3: Update. 4: Destroy."); break; } Console.WriteLine("**********"); Console.ReadKey(); } }
public Lanistamanager(EditorContext db) { DB = db; }
public Usermanager(EditorContext db) { DB = db; }