public async Task <WeightAgeCategoryModel> Save(WeightAgeCategoryModel categoryModel) { var category = _mapper.Map <WeightAgeCategory>(categoryModel); await _repository.Save(category); categoryModel.Id = category.Id; return(categoryModel); }
public async Task <IActionResult> Remove([FromBody] WeightAgeCategoryModel category) { try { await _service.Remove(category.Id); return(Ok(category.Id)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }