public async Task <FightStructureModel> SaveFightStructure(FightStructureModel fightStructureModel) { var fightStructure = _mapper.Map <FightStructure>(fightStructureModel); await _fightStructuresRepository.Save(fightStructure); return(_mapper.Map <FightStructureModel>(fightStructure)); }
public async Task <IActionResult> Remove([FromBody] FightStructureModel structure) { try { await _fightStructuresService.RemoveFightStructure(structure.Id); return(Ok(structure.Id)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Save([FromBody] FightStructureModel structureModel) { try { var structure = await _fightStructuresService.SaveFightStructure(structureModel); return(Created("Add", structure)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }