Exemple #1
0
        /// <inheritdoc />
        public async Task UpdateAsync(long id, FoodUpdate food)
        {
            var entity = await _repo.GetAsync(id);

            _repo.Update(entity);
            _mapper.Map(food, entity);
            await _repo.SaveAsync();
        }
Exemple #2
0
        public async Task <IActionResult> Update(long id, [FromBody] FoodUpdate food)
        {
            await _foodService.UpdateAsync(id, food);

            return(new NoContentResult());
        }