public HeroesController(AppDbContext ctx) { _ctx = ctx; _heroService = new HeroRepository(_ctx); _dragonService = new DragonRepository(_ctx); _hitService = new HitService(_ctx); }
public ResponseModel <IEnumerable <Dragon> > Get() { IEnumerable <Dragon> dragons = DragonRepository.ToList(); return(new ResponseModel <IEnumerable <Dragon> >() { data = dragons, status = true }); }
public ResponseModel <object> Remove(Dragon dragon) { ResponseModel <object> response = new ResponseModel <object>(); response.status = DragonRepository.Remove(dragon); if (response.status != true) { response.statusMessage = "Error Occured"; } return(response); }
public DragonsController(AppDbContext context) { _context = context; _dragonService = new DragonRepository(_context); }
public Dragon Spawn() { Dragon dragon = DragonRepository.Spawn(); return(dragon); }
public JsonResult Dragons() { IEnumerable <Dragon> dragons = DragonRepository.ToList(); return(Json(dragons, JsonRequestBehavior.AllowGet)); }