public async Task <IActionResult> DeleteAsync([FromBody] GameTagResource resource) { var gamegenre = mapper.Map <GameTagResource, GameTag>(resource); var result = await gameTagService.DeleteAsync(gamegenre); if (!result.IsSuccess) { return(BadRequest(result.Message)); } var gameGenreResource = mapper.Map <GameTag, GameTagResource>(result.GameTag); return(Ok(gameGenreResource)); }
public async Task <IActionResult> PutAsync([FromBody] GameTagResource resource) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorMessages())); } var gameGenre = mapper.Map <GameTagResource, GameTag>(resource); var result = await gameTagService.UpdateAsync(gameGenre); if (!result.IsSuccess) { return(BadRequest(result.Message)); } var gameGenreResource = mapper.Map <GameTag, GameTagResource>(result.GameTag); return(Ok(gameGenreResource)); }