Exemplo n.º 1
0
        public void ParsAudsPrepods()
        {
            ParaName paraName1 = new ParaName() { Name = "Matematika" };
            ParaName paraName2 = new ParaName() { Name = "Programming" };
            ParaName paraName3 = new ParaName() { Name = "Fizika" };

            ctx.ParaNames.Add(paraName1);
            ctx.ParaNames.Add(paraName2);
            ctx.ParaNames.Add(paraName3);

            ctx.Pars.Add(new Para() { ParaName = paraName1, Position = 1 });
            ctx.Pars.Add(new Para() { ParaName = paraName2, Position = 2 });
            ctx.Pars.Add(new Para() { ParaName = paraName3, Position = 3 });

            ctx.Auds.Add(new Aud() { Name = "A301" });
            ctx.Auds.Add(new Aud() { Name = "A302" });
            ctx.Auds.Add(new Aud() { Name = "A303" });

            FirstName firstName = new FirstName() { Name = "MegaPrepod" };
            ctx.FirstNames.Add(firstName);

            ctx.Prepods.Add(new Prepod() { FirstName = firstName });
            ctx.Prepods.Add(new Prepod() { FirstName = firstName });
            ctx.Prepods.Add(new Prepod() { FirstName = firstName });


            ctx.SaveChanges();
        }
Exemplo n.º 2
0
 public IActionResult Edit(FirstName firstName)
 {
     if (ModelState.IsValid)
     {
         _context.Update(firstName);
         _context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(firstName);
 }
Exemplo n.º 3
0
 public IActionResult myTest(FirstName firstName)
 {
     return Json(firstName);
 }