//// PUT api/<controller>/5
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        // DELETE api/<controller>/5
        public IHttpActionResult Delete(int id)
        {
            using (var context = new HeroesDalEntities())
            {
                var hero = context.Heroes.ToList().FirstOrDefault(p => p.Id == id);
                if (hero == null)
                {
                    return(NotFound());
                }
                else
                {
                    context.Heroes.Remove(hero);
                    context.SaveChanges();

                    return(Ok(MapFromDAL(hero)));
                }
            }
        }
        public IHttpActionResult PostHero([FromBody] Models.HeroApi heroApi)
        {
            using (var context = new HeroesDalEntities())
            {
                Hero heroDB = null;
                if (heroApi.id == 0) //Add hero
                {
                    heroDB = new Hero();
                    heroDB = MapToDAL(heroApi, heroDB);

                    context.Heroes.Add(heroDB);
                }
                else
                {
                    heroDB = context.Heroes.ToList().FirstOrDefault((p) => p.Id == heroApi.id);
                    heroDB = MapToDAL(heroApi, heroDB);
                }
                context.SaveChanges();

                return(Ok(heroDB));
            }
        }