public IHttpActionResult AddMonster([FromBody] monster monster)
        {
            if (monster == null)
            {
                return(Ok("Monster Empty"));
            }

            _monsterService = GetMonsterService();
            IEnumerable <string> Error = _monsterService.AddMonster(monster);

            return(Ok(Error));
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Post([FromBody] MonsterViewModel monster)
        {
            var addedMonster = await Task.Run(() => _monsterService.AddMonster(monster));

            return(CreatedAtRoute("GetMonsterById", new { id = addedMonster.Id }, monster));
        }