Ejemplo n.º 1
0
        public ActionResult Index(Characters characters)
        {
            db.Characters.Add(characters);
            db.SaveChanges();
            ModelState.Clear();

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Index(Characters characters)
        {
            db.Characters.Add(characters);
            db.SaveChanges();
            ModelState.Clear();

            ViewBag.Message = "Message Sent";


            return(View());
        }
Ejemplo n.º 3
0
 public void Post([FromBody] DungeonLevel level)
 {
     using (var db = new DungeonContext())
     {
         db.Levels.Add(level);
         db.SaveChanges();
         Console.WriteLine($"DungeonLevelId: {level.DungeonLevelId}");
         foreach (DungeonComponent c in level.Components)
         {
             c.DungeonLevelId = level.DungeonLevelId;
         }
         db.Components.AddRange(level.Components);
         db.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public int Post([FromBody] DungeonComponent component)
 {
     using (var db = new DungeonContext())
     {
         db.Components.Add(component);
         db.SaveChanges();
         return(component.DungeonComponentId);
     }
 }
Ejemplo n.º 5
0
 public void Put([FromBody] DungeonComponent component)
 {
     using (var db = new DungeonContext())
     {
         var comp = db.Components
                    .Single(c => c.DungeonComponentId == component.DungeonComponentId);
         comp = component;
         db.SaveChanges();
     }
 }